I currently have 2 lifecycle hooks - afterCreate and afterDelete sending email after an entry is created / deleted by client. Everything is working fine, afterCreate sends email also when I create entry in admin panel, however, when I delete an entry in admin panel, nothing happens. I am using sendgrid as e-mail provider.
module.exports = {
async afterDelete(event) {
const { result } = event;
const date = new Date(result.date);
if (date.getTime() >= new Date().getTime()) {
try {
await strapi.plugins["email"].services.email.send({
to: email1,
from: email2,
subject: subject,
text: "Deleted",