Notification Scenarios
Feature Detail
Description
Notification Scenarios define the rule-based triggers that determine when and why notifications are sent to users. Each scenario encodes a business event (e.g., new assignment dispatched, activity reminder after 10 days, certificate expiry warning, coordinator follow-up prompt) and maps it to a notification payload, target audience, and delivery channels. The scenario engine evaluates these rules against system events and user state, ensuring that the right message reaches the right user at the right time without overwhelming them with irrelevant alerts.
User Flow
Analysis
Scenario-based notifications are the mechanism through which the platform drives follow-up quality and operational discipline. HLF's workshop feedback identified that 40% of peer mentors felt insufficiently followed up - scenario-driven reminders directly address this gap by prompting coordinators and peer mentors at the right moment. Blindeforbundet requires automatic reminders if a contact has not been reached within 10 days of assignment dispatch. These automated prompts reduce coordinator workload, improve peer mentor retention, and ensure Bufdir reporting periods have complete activity coverage, directly impacting grant compliance.
The scenario engine is implemented as a server-side scheduled job (e.g., cron via Vercel Cron Jobs or a background worker) that evaluates configurable scenario rules stored in the scenario_configuration_repository. Each scenario specifies trigger conditions (time-based, event-based, or state-based), target user roles, message templates, and delivery channel priorities. Scenarios reference the notification_preferences table to respect user opt-outs. The engine is designed for extensibility - new scenarios can be added without code changes by inserting configuration records. Payload construction delegates to the shared notification delivery infrastructure from the email/SMS and push notification features.
Components (35)
Shared Components
These components are reused across multiple features
Service Layer (9)
Data Layer (12)
Infrastructure (7)
User Stories
No user stories have been generated for this feature yet.