The messaging module is where 1:1 conversations live: WhatsApp, SMS, email, in-app, tablet, all unified into one inbox. Every conversation hangs off a patient or a lead, every message is logged on their record, and the team can take a conversation on or hand it off cleanly. This guide walks the operating rhythm: who picks up a message, when AI replies for you, when a human must, and the WhatsApp rules that change what you can send and when.

Where it lives#

  • Marketing → Messaging: the inbox.
  • Patient profile → Messages tab: just this patient's conversations.
  • Lead card → Messages tab: just this lead's conversations.
  • Mobile app inbox: same data, on-the-go.

Inbox anatomy#

  • Unread: conversations with new patient messages.
  • Assigned to me: conversations owned by the logged-in user.
  • Unassigned: incoming messages with no owner yet.
  • Resolved: archived conversations, searchable.
  • Filters: by channel (WhatsApp, SMS, email), by team, by tag.

Assignment and routing#

  • Per-channel routing: each WhatsApp / Facebook / Instagram adapter is mapped to one or more branches and to a default reply team in Settings → Channels. Inbound on that channel lands on that team's pool.
  • Auto-assign only fires in the Auto-assign to least-busy online agent mode. The picker looks at the team's online members, filters out anyone at the per-agent chat cap, and gives the chat to the one with the fewest active threads. If no one is online, the chat stays unassigned in the pool.
  • Open pool: the chat stays unassigned and any team member can claim it from the inbox.
  • Supervisor distributes: only the supervisor can claim or assign.
  • Manual reassign: any member with permission can reassign at any time. Source-based routing (campaign reply → marketing team) is not in product today, campaign replies land on the team mapped to the channel.

The WhatsApp 24-hour window, the rule that shapes everything#

What it is#

WhatsApp Business policy: once a user messages your number, you have a 24-hour window to reply with anything (free-form text, media, anything). After 24 hours of silence, you can only send pre-approved template messages. This is a Meta-enforced rule, not a Hoopoe choice.

What it means at the desk#

  • Inside the window: reply normally, send media, send links.
  • Outside the window: only an approved template will deliver. The compose box switches to "template only" and shows your approved templates.
  • The patient replying re-opens the window for another 24 hours.

What templates look like#

  • Pre-registered with WhatsApp Business (WABA) under categories: utility, marketing, authentication.
  • Examples: "Appointment confirmation", "Late payment reminder", "Test results ready", "Birthday wish".
  • Template variables (patient name, date, amount) fill in at send time.
  • Approval takes hours to days. Build the bank before you need it.

Common gotchas#

  • "Why did my message not deliver?" The 24h window closed. Use a template.
  • "Why was my template rejected?" Marketing templates are scrutinised. Keep them clean, do not embed pricing or pressure language.
  • "Can I rush an approval?" Sometimes through a WABA partner, but plan ahead instead.

Templates beyond WhatsApp#

Message templates#

  • Pre-written messages reception can drop into any conversation with one click.
  • Examples: "Directions to the clinic", "Cancellation policy", "Pre-procedure instructions".
  • Variables (patient name, next appointment) fill in automatically.
  • Live at Settings → Message templates.

First-message templates#

  • Specific templates for opening a conversation, e.g. a sales rep first-reaching out to a new lead.
  • Different sales reps can have personal first-message templates that feel like their voice, not a corporate blast.
  • Live at Settings → First-message templates.

Template hygiene#

  • Review templates quarterly. Old offers, old hours, expired campaigns all rot in templates.
  • Localise: every template in every supported language. The patient's preferred language drives which one fires.

AI assist mode#

The team sets the default assignment mode and can enable AI suggestions. Individual conversations also support AI-to-human handover:

  • Open pool (default), Auto-assign to least-busy online agent, Supervisor distributes: the three human modes. Toggle AI suggestions on if you want the AI to draft a reply for the agent to approve.
  • Full AI: the AI answers every inbound autonomously. It escalates to the team when its workflow says so, the team then sees the chat with escalated_at set and the AI stops answering on that thread.

Authorised staff can use the AI control in the conversation header to hand that chat to AI. To take it back, select a human assignee. This is a per-conversation override; the backend determines whether you have assignment rights. Check the resulting handling state before leaving the thread.

What AI never does#

  • Clinical advice. The AI declines and offers to book a consult.
  • Pricing for surgery or aesthetic packages above a threshold. The AI defers to a sales rep.
  • Refund commitments. The AI logs the request, hands to a manager.
  • Patient identity verification. The AI cannot vouch for who is on the other end.

Handover from AI to human#

  • The AI flags the conversation, the system sets escalated_at, clears the AI-handled flag, and writes a system message in the thread naming the reason.
  • The receiving team sees the conversation in the Escalated filter; if Auto-assign mode is on, the next online agent picks it up.
  • Patient experience: one thread, one channel, the patient never sees an AI / human seam, only a brief notice if the AI chose to send one.
  • Human-to-human handover today is a plain reassign. There is no required handover-note dialog; use the conversation's internal notes for context (visible to staff only).

Message status, what each tick means#

Every outbound message walks pending → sent → delivered → read. The system only ever advances the status forward, Meta is allowed to deliver the read webhook before the delivered one, but our visible status never regresses. Failure is terminal: failed overrides whatever the status was. Each timestamp (sent_at, delivered_at, read_at, failed_at) is still written individually for the audit log even if the visible status had already moved past it.

  • One tick = sent to Meta / Unifonic.
  • Two ticks grey = delivered to the patient's device.
  • Two ticks blue = read by the patient (only for channels that report it).
  • Red = failed. Hover for the error code and message.

Response-time SLAs and alerts#

Each team has a target response time in Settings → Messaging → Team → Target response time (default 5 minutes). When an assigned chat sits without an agent reply past that target, the system raises an SLA alert in two stages:

  • Warning: target is approaching. A WebSocket event lights a badge on the assigned agent's inbox tile and pings the supervisor + everyone on the team who is watching the inbox.
  • Breach: target passed. Same alert with severity breach; the inbox can sort breached chats to the top.

There is no email or push escalation on SLA today, the alert is in-app and WebSocket only. Use the team's working-hours config to suspend the timer outside business hours.

Working hours and after-hours autoreply#

Each team configures its working hours per day in Settings → Messaging → Team → Working hours. The hours feed two behaviours:

  • SLA timer: paused outside working hours so the team is not measured against unanswered overnight chats.
  • Greet / engage / nudge / farewell automations: independent toggles under Settings → Messaging → Team → Automations. Each carries its own message body and timing. AI coverage can also depend on the configured team AI window and tenant after-hours policy. Check these separately from greeting and nudge messages.

Any auto-reply must respect the WhatsApp 24-hour window: after the patient's last message expires, only an approved template will deliver.

Agent privacy mode#

Switch this on per team in Settings → Messaging → Team → Privacy. With it on, each agent sees only the chats assigned to them, the "All assigned" and "Closed" filters are scoped to the logged-in user. Supervisors still see the full team inbox. Use this for sales-heavy teams where commission attribution matters or for sensitive verticals.

Conversation context#

  • Open a conversation, the right panel shows the patient or lead summary card, booking info on file, and tags. Outstanding balance and recent invoices are not stitched into this panel today, they are wired into the AI payload so the AI can quote them, but the human-facing side panel does not surface them. Open the patient profile for the full financial picture.
  • Quick actions inline: book, send invoice, mark lead stage, log a task.
  • Internal notes (only visible to staff, not sent to patient) for handover context.

Bulk vs 1:1, when to use which#

  • 1:1 (this module): a conversation. Two-way. Personal.
  • Bulk (Campaigns module): one-to-many broadcasts. Templates only outside the window. Marketing-consent gated.
  • Replies to a bulk land in the 1:1 inbox automatically, the conversation continues there.

Quiet hours and timing#

  • Outbound transactional messages (appointment reminders, results) can fire any hour by default.
  • Outbound marketing messages respect tenant quiet hours (e.g. 22:00-08:00).
  • Per-patient quiet hours override (the patient asked not to be contacted before 10am).
  • Urgent messages (critical lab result, missed dose alert) bypass quiet hours, audited.
  • Patients without marketing consent receive transactional only.
  • Even inside the WhatsApp 24h window, marketing templates require marketing consent. Hoopoe enforces this on send.
  • Consent revocation: a patient texting "STOP" or "UNSUBSCRIBE" auto-revokes. Logged.

Audit and compliance#

  • Every message in and out is stored against the patient or lead record, with author, timestamp, channel, delivery status.
  • Read receipts where the channel supports them.
  • For regulated tenants, message logs are part of the audit export.
  • Deleted messages are tombstoned, not removed, to preserve audit.

KPIs to watch#

  • First-response time: median time from patient message to staff reply. Drives conversion.
  • Resolution time: time from open to resolved.
  • CSAT: optional post-resolution quick survey.
  • AI handover rate: % of AI-handled conversations that handed off to a human. Too low means AI is too eager, too high means humans drown.
  • Template approval mix: which templates are most used, which are unused (and should be retired).

Common mistakes#

  • Replying to a 24h-window-expired conversation with free text: message silently fails. Always check the window indicator in the compose box.
  • Sending marketing through 1:1 to dodge consent: still requires consent. Hoopoe enforces.
  • Leaving the inbox unassigned: messages rot, patient feels ignored. Always assign or claim.
  • AI on Auto without templates: AI cannot help if its tools are empty. Build templates, FAQ, business hours config first.
  • Treating messaging as the lead funnel: it is the conversation layer. Funnel stage lives on the lead card, not the inbox label.

How messaging connects to the rest of the system#

  • Patients and leads: every conversation is anchored to one.
  • Booking: book a session from inside the chat, the confirmation message threads back in.
  • Sales: send an invoice or payment link from the chat.
  • Campaigns: bulk-out, replies land here.
  • Automations: auto-replies, welcome messages, follow-up nudges.
  • WhatsApp WABA: the channel integration, template approval flow.
  • Notifications: inbox alerts in-app and push to mobile.
  • Reports: response and resolution KPIs.