NotificationDispatcher
Component Detail
Description
Central routing layer that receives platform notification events and fans them out to the appropriate channel services based on user preferences and event type. It decouples event producers from channel-specific delivery logic, ensuring that a single event triggers the correct combination of push, email, and SMS dispatch without duplication. Acts as the single entry point for all outbound notification routing.
notification-dispatcher
Sources & reasoning
Line 116 documents HLF's explicit need for improved peer mentor follow-up via scenario-based messages. Email and SMS extend that follow-up capability to users without app access or with push disabled. The source places this in Phase 2 (→ v1.0); blueprint confirms [v1.0].
-
docs/source/likeperson.md · line 116Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.
Responsibilities
- Accept incoming notification events from platform services and route to applicable channels
- Evaluate user channel preferences to determine which services to invoke per event
- Coordinate calls to EmailNotificationService, SmsNotificationService, and push channel services
- Prevent duplicate dispatch when multiple channels are eligible for the same event
- Log dispatch decisions and aggregate delivery outcomes for observability
Interfaces
dispatch(event: PlatformNotificationEvent): Promise<DispatchSummary>
getChannelsForUser(userId: string, eventType: string): Promise<NotificationChannel[]>
registerChannelService(channel: NotificationChannel, service: ChannelService): void
Related Data Entities (5)
Data entities managed by this component