Hello everybody, for some reason, the placeholders in emails are not evaluated:
Using this template:
export const twoFAtemplate = {
subject: '2FA code',
text: `Hey <%= user.firstname %> , twoFA code: <%= twoFAtoken %>.`,
html: `<h1>Hey <%= user.firstname %> !</h1>
<p>twoFA code: <%= twoFAcode %>.<p>`,
};
with the following code:
import { twoFAtemplate } from './mailtemplates';
export const send2FAtoken = async (user: {email: string, firstname: string, [key: string] : any} , twoFAtoken: number) => {
await strapi.plugins['email'].services.email.sendTemplatedEmail(
{
to: user.email,
// from: is not specified, the defaultFrom is used.
},
twoFAtemplate,
{
user: user,
twoFAtoken: twoFAtoken
}
);
}
but what I receive is exactly this:
I followed the docs, what’s wrong about my code ? Thank you in advance !