FEATURE: clearer error message when receiving a reply to an old notification

This commit is contained in:
Régis Hanol
2018-05-09 18:51:01 +02:00
parent deaf3682e9
commit 86eb3528ec
5 changed files with 45 additions and 5 deletions

View File

@ -55,6 +55,7 @@ module Email
when ActiveRecord::Rollback then :email_reject_invalid_post
when Email::Receiver::InvalidPostAction then :email_reject_invalid_post_action
when Discourse::InvalidAccess then :email_reject_invalid_access
when Email::Receiver::OldDestinationError then :email_reject_old_destination
else :email_reject_unrecognized_error
end
@ -75,6 +76,10 @@ module Email
Rails.logger.error(msg)
end
if message_template == :email_reject_old_destination
template_args[:short_url] = e.message
end
if message_template
# inform the user about the rejection
message = Mail::Message.new(mail_string)