I have created a main template in Mailgun, with a {{body}} variable within the HTML code.
Sending emails using this template works fine when passing a simple string to the body variable, but I would like to be able to pass some HTML. Something like that:
return mailgun.messages().send({
from: fromEmail,
to: toEmail,
subject: subject,
template: "main",
"v:body": "<p>This is a <strong>parsed</strong> HTML paragraph.</p>",
}, (error, body) => {
console.log(body);
});
The email gets sent but the body HTML is not rendered and appears as full text in the email (as in showing the tags).
Is there a way to inject HTML so that it is actually rendered?