Suresh Madhaiyan
Suresh Madhaiyan

Reputation: 69

How to trigger mail from email directus schedule cron job in hooks- directus-9.24

In Hooks we have the option to run scheduled cron jobs, so I want to use mail services here, how to get the mailService here?

  1. tried to pass the mail service I schedule parameter is not taking, so I don't know where I need to get the mail services
export default ({ schedule }) => {
    schedule('*/15 * * * *', async () => {
await mailService.send({
                from: payload.email,,
                to: payload.email,
                cc:payload.email, ,
                subject: subject,
                template: {
                    name: ,
                    data: payload,
                },
            });
    });
};

Upvotes: 1

Views: 212

Answers (0)

Related Questions