Skip to content

[Mailer][Mailjet] MailjetApiTransport SentMessage MessageId is Request ID #48550

@mdawart

Description

@mdawart

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:

Yes, correct, these values are of the same format, but are assigned to different things.
The MessageUUID is the ID of the message.
The x-mj-request-guid is the ID of the API request. This is solely saved for us, for logging purposes.

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions