-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Implement EmailTags for Amazon Mailer #45222
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
$tag = explode('=', trim($tag), 2); | ||
|
||
return ['Name' => $tag[0], 'Value' => $tag[1]]; | ||
}, explode(',', $tags)); |
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.
shouldn't we care about escaping?
ie. handling keys/values with special chars like =
or ,
?
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.
How would you approach this?
Not sure why Psalm fails because a type check for the correct type is done right before the place it notes an incompatible type. |
Maybe would be better to use |
Each transport can serialize tags how it needs, so using that header the tags would also work when switching transports |
Hey all, we decided to restore our old custom |
We'll definitely want to use |
Hey @driesvints, I took the liberty to complete this PR using the This doc section describes the usage of |
Thank you @driesvints. |
Oh wauw, thanks for taking that over @kbond, that looks really good! 🙂 👍 |
This PR implements support for
X-SES-MESSAGE-TAGS
headers with the Amazon Mailer. See example of this here: https://docs.aws.amazon.com/ses/latest/dg/event-publishing-send-email.htmlI'm sending this in because atm we can't provide support for this in Laravel 9 after switching to Symfony Mailer. Since the transports are completely closed from adding additional headers before sending them to the
SendEmailRequest
class, the only way to add this is by adding it directly in the transports.I tried my best with writing a function that'll parse the header and prep the array to be sent to the
SendEmailRequest
class.Ideally, it would be great if this could be added to 6.0 as well because Symfony 6.1 is due to be released in May while Laravel 9 is being released in less than two weeks. But, we can always re-implement our old SesTransport (something I'm going to prep regardless so that's ready to go if this can't be back ported to 6.0).
I haven't sent in a PR to the docs because there aren't any docs yet for other X-SES- headers.
Thanks!
PS.: Because I used the GH CLI to send this in I didn't see the PR template. Therefor @carsonbot already added all these labels and I can't remove them anymore.