From d42a1c8885ab7e6c742e09acb01c613e8579e1cc Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Tue, 4 Jun 2024 08:00:30 -0500 Subject: [PATCH] DEV: Pass recipient email address to message_builder modifiers (#27308) --- lib/email/message_builder.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb index 63160eb9835..eff1a4f9efd 100644 --- a/lib/email/message_builder.rb +++ b/lib/email/message_builder.rb @@ -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