Open TonyTR opened 3 years ago
Hey @TonyTR , thanks for opening this suggestion. Would you be interested in taking this on? If not then this could potentially be added early next year.
In case someone need this. You can acctually send templates , just need to add the corresponding parameters to the function like this. Note: text and html params must be sent because they are required by the function of you are gonna get errors, but they are ignored and the template is sent
// lifecycles.js
module.exports = {
async afterCreate(event) {
const { result } = event;
try {
await strapi.plugins["email"].services.email.send({
to: result.email,
from: "info@store.online", //e.g. single sender verification in SendGrid
replyTo: "info@store.online",
subject: "Welcome",
text: "Bienvenido! " + result.name,
html: "Bienvenido ! " + result.name,
TemplateID: 4495580,
TemplateLanguage: true,
TemplateErrorDeliver: true,
Variables: { name: result.name },
});
} catch (error) {
console.log("Error sending welcome email ", error);
}
},
};```
hello @ScottAgirsit is possible to add the options of param the possibility of using a template ? (https://dev.mailjet.com/email/guides/template-api/) -> TemplateID: 1, with for example : settings: { defaultTemplateId: 1, }