Closed
Description
Description
Transports like Postmark and Mailgun support message metadata and tags. The context of this issue will be Postmark.
#34766 implements tag support in Postmark by using a Tag
header. This will work when using the Postmark API transport but not using the SMTP transport. For SMTP you need to add a custom header:
X-PM-Tag: password-reset
With the Postmark API, metadata is a key, value object added to the payload:
"Metadata": {
"Color":"blue",
"Client-Id":"12345"
}
With SMTP, it is a custom header for each value:
X-PM-Metadata-Color: blue
X-PM-Metadata-Client-Id: 12345
Example
Ideally, it would be nice to be able to do the following:
$email->setTag('password-reset');
$email->addMetadata('Color', 'blue');
$email->addMetadata('Client-Id, '12345');
Then the transports could convert to their specific tag/metadata format.
I can work on a PR for this if we can nail down how we want this to work.