Objective: Decouple "What to say" from "How to send it." Replace direct email/push logic with a Template Engine that supports multi-channel routing, user-defined frequency caps (anti-spam), and delivery status tracking (Sent/Delivered/Failed).
Files involved (9):
models/NotificationTemplate.js (New: Stores email/push content)
services/notificationOrchestrator.js (New: Routes messages based on user preferences)
utils/templateResolver.js (New: Injects variables into templates)
middleware/notificationGuard.js (New: Rate limiting for alerts)
routes/notifications.js
(New: User preference management API)
listeners/EmailListeners.js
(Update: Refactor to use Orchestrator)
listeners/AuditListeners.js
(Update: Refactor to use Orchestrator)
templates/notificationTemplates.js
(Update: Heavy content expansion)
NOTIFICATION_SPEC.md (Technical spec)
Objective: Decouple "What to say" from "How to send it." Replace direct email/push logic with a Template Engine that supports multi-channel routing, user-defined frequency caps (anti-spam), and delivery status tracking (Sent/Delivered/Failed).
Files involved (9):
models/NotificationTemplate.js (New: Stores email/push content)
services/notificationOrchestrator.js (New: Routes messages based on user preferences)
utils/templateResolver.js (New: Injects variables into templates)
middleware/notificationGuard.js (New: Rate limiting for alerts)
routes/notifications.js
(New: User preference management API)
listeners/EmailListeners.js
(Update: Refactor to use Orchestrator)
listeners/AuditListeners.js
(Update: Refactor to use Orchestrator)
templates/notificationTemplates.js
(Update: Heavy content expansion)
NOTIFICATION_SPEC.md (Technical spec)