-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage of custom headers #88
Comments
@rmarescu great catch, thanks a lot for opening this issue, I will get a fix in to support the Rails API |
We're also working on adding in the custom headers support when using vanilla Rails with SMTP. |
@rmarescu custom headers support on SMTP was just released. |
@rmarescu i just released version 0.17.0 that should include support for the Rails API |
also updated the resend-rails-example with custom headers usage example |
Hey,
I'm working on a migration from SendGrid to Resend, and noticed that the usage of custom headers seems different from the Rails API.
Here is the sample code suggested:
When used as-is, it works well with Resend: the custom header
X-Entity-Ref-ID
shows up on the Resend UI, and also as a custom header within the recipient email.However, using this setup with another provider (i.e. SendGrid), it yields different results. From Rails' perspective,
headers
key above is actually a custom header's field name. So this code would generate 2 custom headers with field namestags
(expected) andheaders
.Rails' recommended way of passing headers is through the
headers
method. That works as expected with SendGrid, but not with Resend.Is this intended behaviour? As we migrate over from SendGrid, we need to support both email providers in parallel, and set custom headers for both.
Semi-related - I've noticed that, when using Rails with SMTP, none of the custom headers are present in the recipient's email.
Here is some sample code to reproduce the issue (redacted PII):
Partial raw email when sent via Resend (
X-Custom-Header
is not present):Partial raw email when sent via SendGrid (
X-Custom-Header
is present as a header, alongsideheaders
andtags
)The text was updated successfully, but these errors were encountered: