DEV: Pass recipient email address to message_builder modifiers (#27308)

This commit is contained in:
Mark VanLandingham 2024-06-04 08:00:30 -05:00 committed by GitHub
parent 0ddad8fc64
commit d42a1c8885
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -28,12 +28,14 @@ module Email
:message_builder_visit_link_to_respond,
"user_notifications.visit_link_to_respond",
@opts,
@to,
)
@reply_by_email_key =
DiscoursePluginRegistry.apply_modifier(
:message_builder_reply_by_email,
"user_notifications.reply_by_email",
@opts,
@to,
)
if @opts[:include_respond_instructions] == false
@ -136,7 +138,7 @@ module Email
else
subject = @opts[:subject]
end
DiscoursePluginRegistry.apply_modifier(:message_builder_subject, subject, @opts)
DiscoursePluginRegistry.apply_modifier(:message_builder_subject, subject, @opts, @to)
end
def html_part
@ -174,7 +176,7 @@ module Email
html_body: html_override.html_safe,
},
)
html = DiscoursePluginRegistry.apply_modifier(:message_builder_html_part, html, @opts)
html = DiscoursePluginRegistry.apply_modifier(:message_builder_html_part, html, @opts, @to)
Mail::Part.new do
content_type "text/html; charset=UTF-8"
@ -195,7 +197,7 @@ module Email
body << "\n"
body << @template_args[:unsubscribe_instructions]
end
DiscoursePluginRegistry.apply_modifier(:message_builder_body, body, @opts)
DiscoursePluginRegistry.apply_modifier(:message_builder_body, body, @opts, @to)
end
def build_args