mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 10:11:25 +08:00
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:
@ -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]
|
||||
|
Reference in New Issue
Block a user