I have a Postmark email template where the dynamic variable contains html. However, it processes that html as plain text.
More concretely, I have the code below. The variable body
is sent to the email template, however the <br><br>
is displayed as text instead of that it goes to the next line.
In controller:
const body = "Hi...<br><br> Welcome to our a new episode.";
client.sendEmailWithTemplate(
{
TemplateAlias: process.env.POSTMARK_TEMPLATE,
TemplateModel: {
body: body
},
From: from,
To: email,
});
In Postmark template:
<tr>
<td>
1. The following includes text with a br break: {{body}}
</td>
</tr>
<tr>
<td>
2. This line includes a br break directly in the template: How are you? <br> Anything new?
</td>
</tr>
This results in an email where the br break does work on location 2 but not on location 1. On location 1 <br> <br>
is displayed as text: "<br> <br>
".
What am I doing wrong?