Send email afterCreate teks

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2021-05-24 18:57:12 +02:00
parent d78d3def2d
commit 3aa023093e
+10
View File
@@ -20,6 +20,16 @@ module.exports = {
const awtis = await jwennAwtisEpiId(data.awtis)
data.slug = slugify(`${awtis}-${data.tit}`, {lower: true, remove: /[*#+~.()'"!:@]/g})
}
},
afterCreate: async data => {
if (data.user) {
strapi.services.email.send(
process.env.SMTP_FROM,
process.env.SMTP_SEND_TO,
`Nouveau texte de ${data.user.username} : "${data.tit}"`,
`Le titre "${data.tit}" a été soumis depuis le site.`
)
}
}
}
}