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

custom headers with smpt relay #29

Open
thber190356 opened this issue Jan 6, 2020 · 3 comments
Open

custom headers with smpt relay #29

thber190356 opened this issue Jan 6, 2020 · 3 comments

Comments

@thber190356
Copy link

When I'm sending custom headers using SMTP relay, my mayljet transactional template is assigned correctly with the X-MJ-TemplateID but X-MJ-Vars variables are not included in the content of the template. Any idea what I'm doing wrong?

Code in PHPMailer:
$mail->addCustomHeader('X-MJ-TemplateID','xxxxx');
$mail->addCustomHeader('X-MJ-TemplateLanguage','true');
$mail->addCustomHeader('X-MJ-Vars','{"name":"xxx", "city:xxx"}');

@AntoineGst
Copy link

Hi @thber190356,
use $mail->addCustomHeader('X-MJ-TemplateLanguage','1'); instead

@thacac
Copy link

thacac commented May 8, 2022

Hello @thber190356 @AntoineGuestin I've the same issue implementing it via Symfony: no way to get the Vars values in sent mail when other headers are OK :(
@thber190356 did you finally found a solution ? thanks a lot

@NashIlli
Copy link

NashIlli commented May 26, 2022

I found a solution for this issue! You MUST pass the Json object as string.
I used
'X-MJ-Vars': JSON.stringify(variables)}
and it worked

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

4 participants