UX: better rejection message when reply via email is too short

This commit is contained in:
OsamaSayegh
2018-08-02 22:43:53 +03:00
parent 3dbaaf0d74
commit a157dfd418
5 changed files with 69 additions and 2 deletions

View File

@ -52,6 +52,7 @@ module Email
when Email::Receiver::TopicNotFoundError then :email_reject_topic_not_found
when Email::Receiver::TopicClosedError then :email_reject_topic_closed
when Email::Receiver::InvalidPost then :email_reject_invalid_post
when Email::Receiver::TooShortPost then :email_reject_post_too_short
when Email::Receiver::UnsubscribeNotAllowed then :email_reject_invalid_post
when ActiveRecord::Rollback then :email_reject_invalid_post
when Email::Receiver::InvalidPostAction then :email_reject_invalid_post_action
@ -69,6 +70,10 @@ module Email
template_args[:post_error] = e.message
end
if message_template == :email_reject_post_too_short
template_args[:count] = SiteSetting.min_post_length
end
if message_template == :email_reject_unrecognized_error
msg = "Unrecognized error type (#{e.class}: #{e.message}) when processing incoming email"
msg += "\n\nBacktrace:\n#{e.backtrace.map { |l| " #{l}" }.join("\n")}"