diff --git a/lib/resend/mailer.rb b/lib/resend/mailer.rb index 5ec41ea..9bdc1f7 100644 --- a/lib/resend/mailer.rb +++ b/lib/resend/mailer.rb @@ -14,7 +14,7 @@ class Mailer cc bcc from reply-to to subject mime-version html text - content-type tags scheduled_at + content-type content-transfer-encoding tags scheduled_at headers options ].freeze diff --git a/spec/railtie/mailer_spec.rb b/spec/railtie/mailer_spec.rb index 9bfcfde..0e083a9 100644 --- a/spec/railtie/mailer_spec.rb +++ b/spec/railtie/mailer_spec.rb @@ -207,4 +207,13 @@ class TestMailerWithDisplayName < TestMailer body = @mailer.build_resend_params(message) expect(body[:headers].keys).to eq(["custom-header2"]) end + + it "filters content-transfer-encoding from custom headers" do + expect(Resend::Mailer::IGNORED_HEADERS).to include("content-transfer-encoding") + + message = TestMailer.html_text_msg("test@example.org", "Test!") + body = @mailer.build_resend_params(message) + headers = body[:headers] || {} + expect(headers).not_to have_key("Content-Transfer-Encoding") + end end