feat: event registration emails and reminders (reminders untested)

This commit is contained in:
2026-09-24 00:55:47 +02:00
parent 1879a206ad
commit e5bce55bf7
9 changed files with 757 additions and 1 deletions
+15
View File
@@ -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.');
}
},
};