2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FIX: don't send out elided message in email notifications

UX: improved details tag for elided messages
This commit is contained in:
Régis Hanol 2016-03-11 17:51:16 +01:00
parent bf209d8344
commit 6d84a8a1b3
6 changed files with 56 additions and 12 deletions

View file

@ -56,9 +56,14 @@ module Email
@incoming_email.update_columns(user_id: user.id)
body, elided = select_body
body ||= ""
body << "\n\n[details=...]\n#{elided}\n[/details]" if elided.present?
if elided.present?
body << "\n\n" << "<details class='elided'>" << "\n"
body << "<summary title='#{I18n.t('emails.incoming.show_trimmed_content')}'>&#183;&#183;&#183;</summary>" << "\n"
body << elided << "\n"
body << "</details>" << "\n"
end
raise AutoGeneratedEmailError if is_auto_generated?
raise NoBodyDetectedError if body.blank? && !@mail.has_attachments?