mailjet-apiv3-nodejs
mailjet-apiv3-nodejs copied to clipboard
Unable to send emails using a template
Following the documentation to send an email using a template does not work, I am trying to send an email using the API v3.1, e.g: Guide to use a Template.
I even tried to instantiate the apiConnect
as in this documentation but non of the previous guides worked.
I inspected the request and the mails apparently were sent without errors, but in the mail report they appear as blocked. When I tested the template, the email was sent successfully, the template is currently active. I got two emails verified to act as senders.
The following snippet is being executed within an async function, the response return a 200 status code with some more details without errors but the mails appear as blocked in the report:
const request = await mailjet.post('send', { version: 'v3.1' }).request({
Messages: [
{
From: {
Email: '<SENDER_EMAIL>',
Name: '<SENDER_NAME>',
},
To: [
{
Email: '<DESTINATION_EMAIL>',
Name: '<DESTINATION_NAME>',
},
],
TemplateID: 12345678, // This is not the real templateID.
TemplateLanguage: true,
Subject: '<EMAIL_SUBJECT>',
},
],
});
Can someone help me please?