Send email afterCreate teks
This commit is contained in:
@@ -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.`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user