Notifications
Multi-channel notification system delivering messages via email, SMS, and in-app channels.
Architecture
| Layer | Location |
|---|---|
| Notification processors | backend/src/lib/notifications/ |
| Email templates | backend/src/lib/email-templates/ |
| SMS module | backend/src/lib/sms/ |
| Portal notifications | portalNotifications DB table |
| Notification bell | PortalNotificationBell component |
Channels
| Channel | Provider | Implementation |
|---|---|---|
| Resend Email | backend/src/lib/email-templates/ | |
| SMS | MessageBird SMS | backend/src/lib/sms/ |
| In-app (portal) | Internal | portalNotifications table + PortalNotificationBell |
Notification Types
| Type | Channel(s) | Trigger |
|---|---|---|
| Document obtaining reminders | Email, SMS | Overdue document requests |
| Document rejection | Email, in-app | Document Review rejection |
| Appointment confirmation | Email, SMS | Appointment booked |
| Portal access | Email, SMS | New Portal token issued |
| Form submission confirmation | Form submitted |
Background Processing
Notifications are processed asynchronously via Background Jobs (BullMQ notification queue). This prevents notification delivery from blocking API responses and provides retry capabilities for transient failures.
Document Obtaining Reminders
Dedicated tables track reminder state:
| Table | Purpose |
|---|---|
documentObtainingReminderHistory | Tracks when reminders were sent per document request |
documentObtainingNotifications | Configures reminder schedules and escalation rules |
See Document Obtaining for the full document collection workflow.
Email Templates
Email templates at backend/src/lib/email-templates/ are HTML templates with placeholder interpolation. Template selection and content are managed through the Admin Dashboard (email template settings).
SMS Delivery
SMS messages are sent via MessageBird SMS with SMS_CATCH_ALL_PHONE_NUMBERS for development/staging environments (prevents sending real SMS during testing).
In-App Notifications
The portalNotifications table stores in-app notifications for Portal users. The PortalNotificationBell component displays unread count and notification list.
Related
- Portal — in-app notification delivery
- Document Obtaining — document reminder notifications
- Background Jobs — async notification processing
- Resend Email — email delivery provider
- MessageBird SMS — SMS delivery provider
- Admin Dashboard — email template configuration
- Appointments — appointment notification triggers