feat: Add daily event notification emails via cron job
- Add node-cron for scheduled tasks - Create cron/calendar structure with: - email-template.js: HTML email template for event notifications - event-notifier.js: Logic to query tomorrow's events and send emails - index.js: Cron scheduler (runs daily at configurable time) - Send notifications via JMAP using sender email from database - Add admin endpoint POST /api/admin/trigger-notifications for testing - Add env variables: NOTIFICATION_TIME, NOTIFICATION_SENDER_EMAIL 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
17
src/cron/index.js
Normal file
17
src/cron/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { logger } from '../utils/logger.js';
|
||||
import { startCalendarNotificationCron, triggerEventNotifications } from './calendar/index.js';
|
||||
|
||||
/**
|
||||
* Start all cron jobs
|
||||
*/
|
||||
export const startAllCronJobs = () => {
|
||||
logger.info('=== Inicializujem cron jobs ===');
|
||||
|
||||
// Calendar event notifications
|
||||
startCalendarNotificationCron();
|
||||
|
||||
logger.info('=== Všetky cron jobs inicializované ===');
|
||||
};
|
||||
|
||||
// Export individual functions for testing/manual triggers
|
||||
export { triggerEventNotifications };
|
||||
Reference in New Issue
Block a user