mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
a6be4972a8
When we build and send emails using MessageBuilder and Email::Sender we add custom headers defined in SiteSetting.email_custom_headers. However this was causing errors in cases where the custom headers defined a header that we already specify in outbound emails (e.g. the Precedence: list header for topic/post emails). This commit makes it so we always use the header value defined in Discourse core if there is a duplicate, discarding the custom header value from the site setting. cf. https://meta.discourse.org/t/email-notifications-fail-if-duplicate-headers-exist/222960/14
10 lines
214 B
Ruby
10 lines
214 B
Ruby
# frozen_string_literal: true
|
|
|
|
class TestMailer < ActionMailer::Base
|
|
include Email::BuildEmailHelper
|
|
|
|
def send_test(to_address, opts = {})
|
|
build_email(to_address, template: 'test_mailer', **opts)
|
|
end
|
|
end
|