Skip to content

[Mailer] Fix reply-to functionality in the SendgridApiTransport #37527

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

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

jt2k
Copy link
Contributor

@jt2k jt2k commented Jul 8, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

When sending a message using the SendgridApiTransport, the reply-to address was being ignored. In other transports, the reply to can be set using headers, but SendGrid requires that certain fields be added explicitly to the API payload. This is already handled for From, To, Cc, Bcc, and Subject, but was not handled for Reply-To. This change extracts the reply to address from the Email object and adds it to the payload.

Note that the Email object allows for multiple Reply-To addresses, but SendGrid only supports a single one, so I am just using the first element of the array.

I also fixed a link in a comment to SendGrid's documentation explaining the reserved headers that are not allowed.

@fabpot fabpot force-pushed the mailer-sendgrid-replyto branch from 8c46659 to 2cf25d1 Compare July 15, 2020 12:22
@fabpot
Copy link
Member

fabpot commented Jul 15, 2020

Thank you @jt2k.

@fabpot fabpot merged commit fd13f5f into symfony:4.4 Jul 15, 2020
This was referenced Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants