feat: event registration emails and reminders (reminders untested)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Core } from '@strapi/strapi';
|
||||
|
||||
import { runBootstrap } from './bootstrap';
|
||||
import { runEventReminders } from './lib/event-reminders';
|
||||
|
||||
export default {
|
||||
/**
|
||||
@@ -21,5 +22,19 @@ export default {
|
||||
*/
|
||||
async bootstrap({ strapi }: { strapi: Core.Strapi }) {
|
||||
await runBootstrap({ strapi });
|
||||
|
||||
// The cron provider always runs its own `start()`, so `strapi.cron.add()`
|
||||
// here schedules immediately. Respect the explicit opt-out in
|
||||
// `server.cron.enabled` (env `CRON_ENABLED`): without SMTP configured the
|
||||
// hourly job would just fail and log, so it stays inert by default.
|
||||
if (strapi.config.get('server.cron.enabled', false)) {
|
||||
strapi.cron.add({
|
||||
'send-event-reminders': {
|
||||
task: runEventReminders,
|
||||
options: { rule: '0 * * * *', tz: 'Africa/Tripoli' },
|
||||
},
|
||||
});
|
||||
strapi.log.info('[index] event reminder cron job registered.');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user