Skip to content
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

[Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID #49992

Closed
wants to merge 6 commits into from
Closed

[Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID #49992

wants to merge 6 commits into from

Conversation

Starfox64
Copy link
Contributor

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.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title [Mailer][Mailjet] Use body MessageID instead of X-MJ-Request-GUID [Mailer] [Mailjet] Use body MessageID instead of X-MJ-Request-GUID Apr 10, 2023
@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

@Starfox64
Copy link
Contributor Author

Will submit updated tests tomorrow, seems the dummy response's Messages field is missing a real message's data.

@Starfox64
Copy link
Contributor Author

AppVeyor is failing because it does not seem to support 64 bit integers. Is this a requirement for 5.4 or any of the later Symfony versions?

@Starfox64
Copy link
Contributor Author

AppVeyor appears to be failing for unrelated reasons now (Form component).

If this is all good let me know so I can squash this branch since I've forked into our org.

@nicolas-grekas
Copy link
Member

Thank you @Starfox64.

nicolas-grekas added a commit that referenced this pull request Apr 18, 2023
…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
This was referenced Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants