Notifications are how the system reaches people. Patients get their reminders, providers get their critical-result alerts, managers get their overdue tasks. The wrong channel at the wrong hour annoys, the right one earns trust. This article walks the five channels, how routing works, and how to think about delivery when the engine does not retry across channels.

Coming soon. Automatic cross-channel fallback chains, per-staff quiet-hour overrides and urgent escalation chains are not universal capabilities. Today: each intent fires on the channels the caller declared, without a general cross-channel fallback chain. Post-visit review requests separately respect tenant quiet hours, defaulting to 21:00–09:00 local.

Where it lives#

  • Settings → Notification preferences: tenant defaults per event type.
  • Settings → Message templates: the templates each notification uses.
  • Patient profile → Contact preferences: per-patient channel preferences.
  • Employee profile → Notification preferences: per-staff channel preferences.
  • Reports → Notifications → Delivery log: every fire, every outcome.

The five channels#

WhatsApp#

  • Preferred for patient-facing in most regions.
  • Subject to the 24-hour conversational window. Outside: template-only.
  • Templates pre-approved by WABA.
  • Delivery and read receipts visible.
  • Cost per message (template) in some regions.

SMS#

  • Universal reach. No window restriction.
  • Limited length (160 chars per segment, longer messages split).
  • No rich media.
  • Cost per segment.
  • Acts as a primary channel for users without WhatsApp. There is no automatic cross-channel fallback. If WhatsApp fails for a specific user, SMS does not pick up on its own. The caller has to enqueue an SMS intent explicitly, which today only the messaging composer does manually.

Email#

  • Rich content, attachments, longer text.
  • Good for invoices, receipts, lab result PDFs, marketing newsletters.
  • Slower delivery, lower open rates than WhatsApp.
  • Use as primary for transactional documents, secondary for urgent alerts.

Push notification#

  • To the patient or staff mobile app.
  • Real-time, attention-getting.
  • Best for urgent: arrived patient, critical result, overdue task.
  • Requires the app to be installed and notifications enabled.

In-app#

  • The bell icon inside the dashboard or portal.
  • Persistent, see when convenient.
  • Best for non-urgent: a task assignment, a report ready.
  • Never the only channel for urgent.

Routing per event type#

The pattern#

Every event type (appointment confirmation, payment receipt, critical lab result, overdue task, low-stock alert, etc.) has a default channel mapping. Per audience (patient, staff, manager), per priority, the system picks the right channel.

Examples#

  • Appointment confirmation (patient): WhatsApp first, SMS fallback, email if no phone.
  • Reminder (patient): same.
  • Critical lab (provider): verify the channels configured for that clinical alert. Requested channels dispatch independently; a timed escalation from an unread push to SMS is not provided by the generic dispatcher.
  • Overdue task (staff): in-app first, push if app available, email if > 24h.
  • Low-stock (inventory manager): in-app and email daily digest.
  • Payment receipt (patient): WhatsApp + email.
  • Welcome new patient: WhatsApp.
  • Marketing campaign: WhatsApp / SMS based on consent and channel preference.

Fallback in practice today#

The engine does not yet retry a failed send on a different channel. Each intent declares the channels it wants and each channel fires (or fails) independently. The audit log records every attempt and outcome.

If you need a belt-and-braces "WhatsApp plus SMS" pattern for critical sends, the caller has to request both channels up front. The messaging composer is the only place that today lets staff push a manual second channel after a primary failure. A cross-channel escalation chain with timed retries is on the roadmap.

Quiet hours#

Messaging Defaults stores tenant quiet hours and whether they also block transactional sends. The provider dispatcher enforces this guard for sends using that pipeline: marketing is blocked during configured quiet hours, while transactional sends pass unless blocking is enabled. This is not a guarantee that every legacy sender defers a message for later. Post-visit review requests also apply their own quiet-hours check, defaulting to 21:00–09:00 local. Check the specific flow and its audit outcome.

Staff notifications#

Default channel mapping for staff#

  • In-app: anything that needs eyes today, low urgency.
  • Push: anything needing eyes within an hour.
  • SMS / WhatsApp: anything urgent off the dashboard (after-hours, on-call).
  • Email: digest summaries, no real-time expectation.

Per-staff override#

  • Each employee can adjust their own channel preferences.
  • Cannot opt out of urgent for safety reasons.
  • Can mute non-urgent during off-hours.

Templates per channel#

  • Each event-type has a default template per channel.
  • Templates support variables: patient name, appointment time, clinic name, etc.
  • WhatsApp templates need WABA approval.
  • SMS templates plain text, short.
  • Email templates can be HTML-rich.
  • Per-language: every template in every supported language.

Rate limits in practice#

The in-app channel has a per-user rate cap to prevent bell-spam during incidents. If a single user receives more than a few dozen in-app notifications within a short window, the next ones are dropped and a Sentry warning fires. The other channels are not rate-limited inside the system; their provider rate limits apply (WhatsApp via the WABA quality tier, SMS via the Unifonic account, etc.).

Grouping is the other tool that keeps the bell quiet. When the same kind of event fires repeatedly for the same user inside the grouping window, the in-app notification consolidates them into one row with a "N similar updates" badge. Per-channel outbound sends still fire individually unless the caller deduplicates upstream.

Opt-out handling#

  • Patient texts "STOP" or clicks unsubscribe: marketing consent revoked.
  • Transactional still flows (reminders, receipts).
  • Full opt-out (also transactional) is owner-only with documented reason.
  • Opt-out per channel: patient can stay on email but disable WhatsApp.

Delivery log and audit#

  • Every send: timestamp, channel, recipient, template, payload, outcome (delivered, read, failed).
  • Searchable by patient, by template, by date range.
  • Failed-deliveries dashboard for ops triage.
  • Per-template metrics: open rate, click rate, opt-out rate.
  • Audit retention per regulator (commonly 1+ year for marketing, 7+ for clinical).

KPIs#

  • Delivery rate: % of sends that delivered. Target > 95%.
  • WhatsApp window utilisation: % of conversations replied inside 24h.
  • Template approval rate: % of submitted templates approved by WABA.
  • Opt-out rate: marketing opt-outs per send. > 0.5% suggests templates too aggressive.
  • Reminder no-show effect: no-show rate among reminded vs not. Positive impact = the system is paying back.
  • Channel cost: monthly spend on WhatsApp and SMS, against the conversion / retention impact.

Common mistakes#

  • Same urgent alert in all five channels: noise. Pick the most reliable per event.
  • Marketing send without consent check: even if you wrote the rule, regulator will catch you.
  • Push as the only channel for critical: app off, app uninstalled, alert lost. Always fallback to SMS for urgent.
  • Templates not localised: patient gets English in an Arabic-language relationship.
  • No per-patient quiet hours: a polite system asks once, remembers, and respects.
  • Skipping the delivery log: silent failures accumulate.
  • Too-low rate limit: legitimate notifications queue and arrive late.
  • Too-high rate limit: a misfiring rule floods the patient.

Demo tenant safety#

Demo tenants (schema names starting with demo_) block every outbound notification by default, useful when running sales demos with seeded patients you do not want to ping in real life. Allow a specific phone number to receive demo sends by adding it to the tenant's whitelist (config flag DEMO_NOTIFICATION_WHITELIST). All other recipients see the notification recorded as "suppressed by demo guard" on the audit row.

How notifications connect to the rest of the system#

  • Every module: events emit, notifications fire.
  • Automations: rules action to messaging via the notification layer.
  • Messaging: 1:1 conversation surface, replies route back.
  • Patient profile: contact and channel preferences.
  • Employee profile: staff preferences.
  • Reports: delivery and engagement metrics.
  • Audit log: every send recorded.