mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
UX: better rejection message when reply via email is too short
This commit is contained in:
@ -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")}"
|
||||
|
Reference in New Issue
Block a user