-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Allow to add new headers to a SentMessage object #45871
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
Comments
Please note that I'm still not 100% sure this is needed. Would love to get some feedback on this here first to make sure nothing important is missed. |
I agree with your conclusions above. Feels like maybe protected function doSend(SentMessage $message): void
{
// Perform sending...
$message->addInfo('SES-Message-ID', $result->getMessageId());
$message->addInfo('some-other-useful-metric', $result->somethingElse());
}
// somewhere else
$sentMessage->getInfo('SES-Message-ID'); // "the message id" |
Thank you for this issue. |
Hi @kbond, was this ever added? Someday we'd love to move to the Amazon Mailer but for now it's preventing us to do that. |
Hey Dries, I don't think so but I'll take a fresh look for 6.3. |
Thanks! |
Thank you for this issue. |
Description
In laravel/framework#41615 we restored some old behavior in our SES Transport that adds the
X-Message-ID
andX-SES-Message-ID
headers which contain the value of the message ID generated by SES (not to be confused with the one from Symfony Mailer).Now, we solved this by adding the headers to the original message which is wrapped in the
SentMessage
object that's passed to thedoSend
method of the transport. However, this doesn't seems the correct place to me as the original message should represent the message that's been composed before it's sent off to Symfony Mailer. Modifying it after a send has been performed feels wrong. I believe the correct place to add the headers is to add them to theSentMessage
object. There isn't a way to do this however.Right now, the
symfony/amazon-mailer
transport solves this by calling thesetMessageId
method on theSentMessage
object. However, I feel this is wrong too. This basically replaces the Symfony Mailer generated Message ID with the SES Message ID one. I think it's important that both still remain available because you won't be able to match the messages anymore without the original Symfony Message ID.I've added an example below but I'm more than happy if someone has ideas about why this wouldn't be wanted.
Also pinging @kbond because we were recently in touch about the SES Transport. Right now, there isn't a way for us to move to the Symfony Amazon Mailer since it doesn't provides the
X-Message-ID
andX-SES-Message-ID
headers.Example
Some API like the following is needed I think:
This would allow to add additional message ID's to the
SentMessage
.The text was updated successfully, but these errors were encountered: