-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer][Mailjet] MailjetApiTransport SentMessage MessageId is Request ID #48550
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
We could implode all messageUUIDs as one string an store this as the messageID WDYT @fabpot ? |
That's an interesting behavior. |
I checked this for MessageBird Notifier. MessageBirds API provides only a single id even if there is more than one recipient. And as far as I understand So this should be the same for |
…est-GUID (Starfox64) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #48550 | License | MIT | Doc PR | N/A As per #48550, the message ID of the `SentMessage` returned by the `MailjetApiTransport` is the `X-MJ-Request-GUID`. The issue is that this ID is only there for debug purposes by the MailJet engineers and cannot be consumed by the MailJet API to query the message metadata. This change instead uses the `MessageID` attribute returned in the JSON body of the response which can be used in further API requests. As the existing message ID was not usable for anything besides opening support tickets (which the new ID can still be used for), I've decided to submit this PR as a bug fix. A slight limitation however is that MailJet will return multiple messages when sending to multiple recipients, each having their own `MessageID`. This implementation therefore only returns the first `MessageID`, there is an ongoing discussion on #48550 about that behavior but I am submitting this PR as is since it's still a net improvement over the previous ID. Commits ------- 8b92751 [Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID
Symfony version(s) affected
5.4
Description
The ID assigned using $sentMessage->setMessageId is an ID generated by MailjetAPI for the request but not for the message. If you want to identify messages on webhooks (e.g. bounce or block see https://dev.mailjet.com/email/guides/webhooks/ ) it would not work, you need the MessageUUID
I got this feedback from their support:
Problem is in case there is more than one Recipient more than one MessageUUID is generated and SentMessage can only store a single Id for a message.
https://dev.mailjet.com/email/guides/send-api-v31/#send-a-basic-email
How to reproduce
Send a message using the MailjetApiTransport
Possible Solution
If you need to identify email messages send them as custom headers
$email->getHeaders()->addHeader('MessageID', $this->messageId);
and rely on the value coming back on webhook calls
Additional Context
I am not sure if bug is the right label for this, maybe this is just something to add to the documentation.
The text was updated successfully, but these errors were encountered: