DEV add modifiers to message_builder so plugins can customize subject/body/html (#26867)

This commit is contained in:
marstall
2024-05-13 14:59:15 -04:00
committed by GitHub
parent 2cfcb4042e
commit 6df2f94bbc
3 changed files with 31 additions and 3 deletions

View File

@ -126,7 +126,7 @@ module Email
else
subject = @opts[:subject]
end
subject
DiscoursePluginRegistry.apply_modifier(:message_builder_subject, subject, @opts)
end
def html_part
@ -164,6 +164,7 @@ module Email
html_body: html_override.html_safe,
},
)
html = DiscoursePluginRegistry.apply_modifier(:message_builder_html_part, html, @opts)
Mail::Part.new do
content_type "text/html; charset=UTF-8"
@ -184,8 +185,7 @@ module Email
body << "\n"
body << @template_args[:unsubscribe_instructions]
end
body
DiscoursePluginRegistry.apply_modifier(:message_builder_body, body, @opts)
end
def build_args