[Mailer][Mailgun] Support more headers#36148
Conversation
|
How to set header without prefix? As it was mentioned in the original issue, |
|
Ooops. I forgot those. Is “template” and “amp-html” the only two ‘non-prefixed’ headers? I think I’ll make an exception for those two then. |
The current solution requires update every time new headers are added to Mailgun, as the current history of Mailgun tells us that this happens after a while. It is just a matter of time before the same issue reappears. |
src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php
Outdated
Show resolved
Hide resolved
|
Thank you @greedyivan for the review. I've deprecated passing a header without the "h:" prefix. So we need to "keep up to date" with Mailguns API until Symfony 6.0. |
|
Thank you @Nyholm. |
|
I'm using $email
->from($from)
->replyTo($replyTo)
->to($to)
;And I'm getting |
|
Excellent question! I suggest to open up a new issue for that. That way it wont get lost on a closed PR. |
| } else { | ||
| // fallback to prefix with "h:" to not break BC | ||
| $headerName = 'h:'.$name; | ||
| @trigger_error(sprintf('Not prefixing the Mailgun header name with "h:" is deprecated since Symfony 5.1. Use header name "%s" instead.', $headerName), E_USER_DEPRECATED); |
There was a problem hiding this comment.
This seems weird to me. The h: prefix is a mailgun specific feature. Requiring the Email object to set it means writing Mailgun-specific code in a place that may not even be aware of which transport is used.
This PR was merged into the 5.2 branch. Discussion ---------- Make Mailgun Header compatible with other Bridges | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This revert deprecating passing a header without the required Mailgun `h:` prefix. And makes the bridge compatible with other bridges. See: - #36148 (comment) - #41308 (comment) Commits ------- 82f1f9c Make Mailgun Header compatible with other Bridges
This PR was merged into the 5.2 branch. Discussion ---------- Make Mailgun Header compatible with other Bridges | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This revert deprecating passing a header without the required Mailgun `h:` prefix. And makes the bridge compatible with other bridges. See: - symfony/symfony#36148 (comment) - symfony/symfony#41308 (comment) Commits ------- 82f1f9c618 Make Mailgun Header compatible with other Bridges
This PR was merged into the 6.4 branch. Discussion ---------- [Mailer] remove useless `@legacy` annotation | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT this was added in #36148 and the deprecation was later on reverted in #41380 Commits ------- 4b6be4a remove useless `@legacy` annotation
Im not sure if this should be classified as a bug since "setting headers are broken". Ie, you cannot use some Mailgun API features.
Or, this may be a feature because now you may specify any supported custom header you want.