Notifications are the system-generated messages you didn't write. Booking confirmation, payment receipt, appointment reminder, lab result alert, critical-value notification. They go through one or more channels (WhatsApp, email, SMS, push, in-app) and log every send for audit.
Transactional vs marketing#
Two different things, often confused:
- Transactional: direct response to something that happened (you booked, you paid, your appointment is tomorrow). Recipient consent is presumed because they initiated the relationship. Goes through this module.
- Marketing: promotional, broadcast. Requires explicit opt-in. Goes through Campaigns.
What fires automatically#
Out of the box, the system sends:
- Booking confirmation: when a session is created.
- Booking reminder: 24h and 2h before the appointment.
- Booking rescheduled / cancelled.
- Payment receipt: when an invoice is paid.
- Refund processed.
- Package expiry warning: configurable cadence.
- Lab result ready + critical-value alert.
- Prescription activated.
- Treatment plan started / completed.
- Loyalty tier change.
- Low-stock alert: to inventory manager.
- Overdue invoice reminder.
For admins#
Settings → Notifications#
Channels
Five channels are live: WhatsApp, SMS, email, push, in-app. The provider for each channel is wired at the platform level today. WhatsApp routes through Unifonic by default with a per-role switch to the Meta Cloud API (controlled by your account manager), SMS goes through Unifonic, email goes through the in-house mailer, push goes through Firebase. There is no Settings page yet to swap providers; ask your account manager if you need a specific gateway.
No automatic cross-channel fallback
Each notification intent declares the channels it should fire on. If a WhatsApp send fails, the engine does not automatically try email or SMS for the same intent. The caller decides ahead of time which channels to attempt. If you want a belt-and-braces "WhatsApp plus SMS" pattern, the intent has to request both up front.
Templates
Each notification type has a template per channel. Edit wording, variables, branding. For WhatsApp, templates must be Meta-approved before they can send.
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.
Per-category opt-out
For notifications associated with a user, the dispatcher checks both channel and category preferences unless that flow explicitly bypasses the preference check. Target-only notifications without a user need their own recipient checks. Marketing WhatsApp and SMS intents also consult marketing opt-outs. A preference change is not a guarantee that every essential transactional notice will stop.
Rate limits
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.
Notification audit log#
Settings → Notifications → Audit log. Every notification ever sent: who, when, channel, template, status (sent / failed / suppressed). Filter by patient, channel, date, status.
For staff#
Resend a notification#
There is no Resend button on the audit row yet. To re-send, use the messaging composer to send the appropriate approved template after checking the original delivery status. Keep the appointment intact; cancelling and recreating it changes clinical and operational records. The audit log is read-only today and exists to explain why a message did or did not land.
Suppress for a patient#
If a patient asks to stop a specific notification type, add the do_not_message tag (suppresses marketing) or open the patient's preferences and disable per-category for the in-app bell. Check both channel and category preferences, and use the supported marketing opt-out flow for promotional messages. Essential transactional flows can have different rules.
Demo and sandbox tenants#
Demo schemas have a strict outbound guard. No real WhatsApp, SMS, email, or push goes out from a demo tenant unless the recipient phone or email is on the tenant's whitelist (DEMO_NOTIFICATION_WHITELIST). This protects real customers from accidental test sends during sales demos. If you run a demo and the messages never arrive, that is why. Ask the platform team to add your test number to the whitelist for the duration of the demo. The audit row records the send as "suppressed by outbound guard" so the trace is still visible.
When delivery fails#
Open the notification audit log filtered by the patient. Every send writes a row with channel, template, response code, and reason. The common outcomes:
- Skipped, outbound guard. Demo schema or the recipient is not whitelisted. See above.
- Skipped, rate limit. Too many in-app sends for the same user within the window. Wait or raise the limit.
- Skipped, subscription state. The tenant's plan does not allow sends on that channel today.
- Failed, provider error. Invalid phone, expired template, Meta quality block. Fix the patient profile or the template; the notification does not auto-retry on a different channel.
To recover, check whether the original send succeeded before sending the appropriate template manually from the messaging composer. The audit row stays as evidence of the original attempt.
Why a burst of events shows up as one bell notification#
If the same kind of event fires repeatedly for the same user within a short window, the in-app notification consolidates them: instead of ten rows, you see one row with "10 similar updates" on it. This prevents the bell from drowning the user when an event-bus loop or a batch import fires many events in a row. The grouping window is a few minutes; older events get their own row. Only in-app notifications group; the per-channel outbound sends (WhatsApp / SMS / email / push) still fire individually unless the caller deduplicates upstream.
How notifications connect to the rest of the system#
- Every other module emits intent events that this module handles.
- Messaging: outbound channels are the same adapters; replies land in the messaging inbox.
- Automations: custom notifications via automation handlers.
- Patients: preferred channel + opt-out flags read from here.
- Campaigns: distinct module for marketing broadcast.
Common situations#
- "Patient didn't get their reminder." Check the audit log. If suppressed by the outbound guard or rate limit, explain. If failed (invalid number), update the patient profile and resend by re-triggering the upstream event.
- "Wrong wording in the receipt." Edit the receipt template under Settings → Notifications → Templates. Takes effect immediately.
- "WhatsApp template rejected." Meta has content rules. Edit; resubmit. The system mirrors the status.
- "Want to add the clinic logo to the email receipt." Settings → Notifications → Branding. Upload logo + set primary color.
- "Notifications are going out at 3am." Check Messaging Defaults, the sending pipeline, and the audit result. Provider-dispatcher sends use the quiet-hours guard; legacy paths may differ. Schedule upstream automation explicitly where needed.
- "My demo tenant never sends anything." Demo outbound guard. Add the test number to the whitelist or run against a non-demo tenant.
Related#
- Messaging , 1:1 conversations.
- Campaigns , marketing broadcasts.
- Automations , custom triggers.
- WhatsApp.
