Mercurial Hosting > nabble
diff src/nabble/view/naml/post_by_email.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/view/naml/post_by_email.naml Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,48 @@ +<macro name="post by email" requires="post_by_email" unindent="true"> + <n.catch_exception. id="save-block"> + <n.save_post_by_email /> + </n.catch_exception.> + <n.format_error.handle_exception. for="save-block"> + <n.exception. name="subscription_processing_bad_user"> + <n.send_standard_failure_mail.> + This email address only works for the registered Nabble user who it is assigned to, and you (<n.email_from/>) are not that user. + </n.send_standard_failure_mail.> + </n.exception.> + <n.exception. name="banned"> + <n.send_standard_failure_mail.> + Your email to <n.email_to/> has been rejected because you are not allowed to post to <n.replied_to_node.url/> . Please contact the owner about permissions or visit the Nabble Support forum. + </n.send_standard_failure_mail.> + </n.exception.> + <n.exception. name="bad_mail"> + <n.send_standard_failure_mail.> + Your email to <n.email_to/> couldn't be parsed. + </n.send_standard_failure_mail.> + </n.exception.> + </n.format_error.handle_exception.> +</macro> + +<macro name="save_post_by_email" requires="post_by_email" unindent="true"> + <n.fix_threading/> + <n.if.not.mail_author.can_post_under.replied_to_node> + <then.throw_template_exception name="banned" /> + </n.if.not.mail_author.can_post_under.replied_to_node> + <n.save_to_post/> +</macro> + +<macro name="fix_threading" requires="post_by_email"> + <n.thread_by_subject prefixes="[n.prefixes/]" /> +</macro> + +<macro name="prefixes" requires="post_by_email"> + re|aw|res|fwd|答复 +</macro> + +<macro name="send_standard_failure_mail" dot_parameter="text" requires="post_by_email" unindent="true"> + <n.send_failure_mail.> + Delivery to the following recipient failed permanently: + + <n.nop/> <n.email_to/> + + <n.text/> + </n.send_failure_mail.> +</macro>