Hello,
The variables of my email template are not replaced when I use the sendEmail function.
template
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>Envoyé par {{sender}}</p>
<h1>{{contactSubject}}</h1>
<p>{{content}}</p>
</body>
</html>
My code:
import { sendEmail } from "@netlify/emails";
//...
const requestBody = JSON.parse(event.body) as SendMailDto
console.log("requestBody", requestBody);
await sendEmail({
from: process.env.EMAIL_FROM,
to: process.env.EMAIL_TO,
subject: "SRR - Formulaire de contact",
template: "contact",
parameters: {
sender: requestBody.email,
contactSubject: requestBody.subject,
content: requestBody.message
},
});
The console log show that the object is well filled. But I receive this in my inbox :
PS : it works from this interface. The template is hydrated in the preview section and too in the final test mail in my gmail account.