Commit 41822b8
committed
feature symfony#58761 [Mailer] [Amazon] Add support for custom headers in ses+api (StudioMaX)
This PR was merged into the 7.3 branch.
Discussion
----------
[Mailer] [Amazon] Add support for custom headers in ses+api
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues | Fix symfony#45168 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License | MIT
Until recently it was not possible to add custom headers when using AWS SES API with `Simple` mode, see symfony#45168.
This problem is also mentioned in Mailer's docs:
> If you send custom headers when using the [Amazon SES](https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/Mailer/Bridge/Amazon/README.md) 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:
```php
$mail->getHeaders()->addTextHeader('X-Custom-Header', 'foobar');
```
Commits
-------
6038343 [Mailer] [Amazon] Add support for custom headers in ses+apiFile tree
4 files changed
+35
-1
lines changed- src/Symfony/Component/Mailer/Bridge/Amazon
- Tests/Transport
- Transport
4 files changed
+35
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
126 | 153 | | |
127 | 154 | | |
128 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments