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:
richardtekula
2025-12-15 14:27:53 +01:00
parent 3eb2f6ea02
commit 77754d0668
9 changed files with 660 additions and 0 deletions

View File

@@ -1,6 +1,10 @@
import app from './app.js';
import { startAllCronJobs } from './cron/index.js';
const port = process.env.PORT || 5000;
app.listen(port, () => {
console.log(`🚀 Server running on http://localhost:${port}`);
// Start cron jobs after server is running
startAllCronJobs();
});