Skip to content

[Mailer] [Amazon] Add support for custom headers in ses+api #58761

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
Jan 4, 2025

Conversation

StudioMaX
Copy link
Contributor

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #45168
License MIT

Until recently it was not possible to add custom headers when using AWS SES API with Simple mode, see #45168.
This problem is also mentioned in Mailer's docs:

If you send custom headers when using the Amazon SES transport (to receive them later via a webhook), make sure to use the ses+https provider because it's the only one that supports them.

However, changes have been made to the SendEmail API and now this will be possible from approximately 2024/03/05.
References:
https://docs.aws.amazon.com/ses/latest/APIReference-V2/API_SendEmail.html
https://awsapichanges.com/archive/changes/539fb6-email.html

In this change I add all custom headers to the request, excluding the standard ones, similar to other transports.

Example:

$mail->getHeaders()->addTextHeader('X-Custom-Header', 'foobar');

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@StudioMaX StudioMaX force-pushed the ses-custom-headers branch 4 times, most recently from 6f03c14 to 1f82051 Compare November 5, 2024 13:22
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@fabpot
Copy link
Member

fabpot commented Jan 4, 2025

Thank you @StudioMaX.

@fabpot fabpot merged commit 41822b8 into symfony:7.3 Jan 4, 2025
9 of 10 checks passed
Spomky added a commit to Spomky/symfony that referenced this pull request Feb 26, 2025
Updated the CHANGELOG to reflect the addition of custom headers support in the Amazon SES API mailer. This change will be available starting from version 7.3 instead of 7.2 as per symfony#58761.
Spomky added a commit to Spomky/symfony-docs that referenced this pull request Feb 26, 2025
As per symfony/symfony#58761, the warning about requiring the `ses+https` provider for custom headers is no longer relevant and has been removed.
Fixes symfony#20512
alexandre-daubois added a commit that referenced this pull request Feb 27, 2025
…(Spomky)

This PR was merged into the 7.3 branch.

Discussion
----------

[Mailer] [Amazon] Support for custom headers in ses+api

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues        |
| License       | MIT

Updated the CHANGELOG to reflect the addition of custom headers support in the Amazon SES API mailer. This change will be available starting from version 7.3 instead of 7.2 as per #58761.

Commits
-------

be5fb0d [Mailer] [Amazon] Support for custom headers in ses+api
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Feb 27, 2025
This PR was merged into the 7.3 branch.

Discussion
----------

[Mailer] [Amazon] Remove outdated warning

As per symfony/symfony#58761, the warning about requiring the `ses+https` provider for custom headers is no longer relevant for 7.3 and has been removed. Fixes #20512

Commits
-------

f0be895 [Mailer] [Amazon] Remove outdated warning
@fabpot fabpot mentioned this pull request May 2, 2025
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.

[Mailer/AWS] Custom headers aren't transmitted
3 participants