I working with sendGrid Mail Api to send mail using firebase cloud functions
Here is my code for sending email using sendGrid/Mail API
studentList.forEach(s => {
var e = {
to: s.email,
from: '[email protected]',
subject: "Mail Using Send Grid",
templateId: templateId,
substitutionWrappers: ['{{', '}}'],
substitutions: {
name: s.name
}
}
mailArray.push(e);
});
return sendGrid.send(mailArray).then(() => {
var message = { message: "Mail Successfully sent" };
return response.status(200).send(message);
});
My template in send Grid See the image
Mail is sent but the placeholders are not replaced with substitutionWrappers. Please help me in, as i'm new to this.