Join GitHub today
[Mailer] Send email tag to Postmark API #34766
At the moment, tags can't be added when using the API transport. If adding a header "Tag: email-tag" to current email, the JSON payload is generated with that tag in "Headers" line and doesn't work.
This PR would allow the "Tag" header to be added at the root of JSON payload, ensuring valid payload for Postmark API https://postmarkapp.com/developer/api/email-api making this work properly:
// creates $email $email->getHeaders()->addTextHeader('Tag', 'account-emails');
I checked how to add a test for this, but I noticed tests for Transports are only for Transport connection https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Mailer/Bridge/Postmark/Tests/Transport/PostmarkApiTransportTest.php and not JSON payloads.
This change is for the JSON payload sent to Postmark API, and the modified field is set in the standard email headers. I'm not sure how and where to add it