-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer][Mailgun] Support more headers #36148
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nyholm I suggest removing the deprecation warning
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
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.