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

The "X-MJ-CUSTOMID" header is wrong when sending segment email. #5532

Closed
XRaccourci opened this issue Jan 8, 2018 · 0 comments
Closed

The "X-MJ-CUSTOMID" header is wrong when sending segment email. #5532

XRaccourci opened this issue Jan 8, 2018 · 0 comments

Comments

@XRaccourci
Copy link
Contributor

What type of report is this:

Q A
Bug report? 🔴
Feature request?
Enhancement?

Description:

Adding the 'X-MJ-CUSTOMID' header is available when sending the email in the Mailjet specific code into EmailBundle/Swiftmailer.
The header in message Swift_Mime_Message is not rewritten for the following messages because it is already present in the first message sent. But the "X-MJ-CUSTOMID" shall be unique
The solution is simply to delete the header before rewriting the correct header.

To correct the problem =
Add this "$message->getHeaders()->remove('X-MJ-CUSTOMID');" in line 65 in file Mautic\EmailBundle\Swiftmailer\Transport\MailjetTransport. (obviously before the line adding the correct X-MJ-CUSTOMID)

If a bug:

Q A
Mautic version 2.12.1
PHP version 5.6.30

Steps to reproduce:

  1. Create a segment
  2. Add two leads at least in this segment
  3. Create a manual email and set the precedent segment
  4. Add log in Swift_Transport_AbstractSmtpTransport in the end of send function. Log this => $message->getHeaders()->get('X-MJ-CUSTOMID')->toString() before return.
  5. Send this email
  6. View the log. X-MJ-CUSTOMID is the same for the two differents emails. It's normally different because X-MJ-CUSTOMID is defined like this "leadIdHash-email".

Log errors:

First email headers =
Message-ID: f25dfe7ce718347c82e775477ac11748@mautic.localhost
X-MJ-CUSTOMID: 5a534d0ab2e08-firstemail@gmail.com

Second email headers =
Message-ID: e284329bfe60c1fea2861f01799f0169@mautic.localhost
X-MJ-CUSTOMID: 5a534d0ab2e08-firstemail@gmail.com

XRaccourci pushed a commit to XRaccourci/mautic that referenced this issue Jan 8, 2018
@escopecz escopecz closed this as completed Jan 8, 2018
escopecz added a commit that referenced this issue Jan 8, 2018
Fixes #5532 problem with MailjetTransport header X-MJ-CUSTOMID
XRaccourci pushed a commit to XRaccourci/mautic that referenced this issue Feb 10, 2018
alanhartless added a commit that referenced this issue Mar 26, 2018
Second Fixes #5532 problem with MailjetTransport header X-MJ-CUSTOMID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants