Feature: Include participants at the bottom of PM emails (#5797)

* Feature: Include participants at the bottom of PM emails

... as undecorated links.

https://meta.discourse.org/t/email-notification-recipients-unclear-when-pm-is-sent-to-multiple-users/26934/13?u=featheredtoast

Fix: missing translation for PM mentions

* display membership count as `group (count)`
This commit is contained in:
Jeff Wong
2018-05-03 15:50:06 -07:00
committed by GitHub
parent eca7017a2b
commit 62a8904729
7 changed files with 82 additions and 0 deletions

View File

@ -96,6 +96,13 @@ module Email
html_override.gsub!("%{respond_instructions}", "")
end
if @template_args[:participants].present?
participants = PrettyText.cook(@template_args[:participants], sanitize: false).html_safe
html_override.gsub!("%{participants}", participants)
else
html_override.gsub!("%{participants}", "")
end
styled = Email::Styles.new(html_override, @opts)
styled.format_basic
if style = @opts[:style]
@ -112,6 +119,12 @@ module Email
body = @opts[:body]
body = I18n.t("#{@opts[:template]}.text_body_template", template_args).dup if @opts[:template]
if @template_args[:participants].present?
body << "\n"
body << @template_args[:participants]
body << "\n"
end
if @template_args[:unsubscribe_instructions].present?
body << "\n"
body << @template_args[:unsubscribe_instructions]