For Stakeholders
Why this matters
WhatsApp's 24-hour messaging window is a platform-level rule every business using the WhatsApp Business API has to live with — Dentolize doesn't control it and can't change it. Before this PR, once a patient conversation crossed that window, the clinic had no way to re-engage from within Dentolize; the only path forward was waiting for the patient to write first. This closes that dead end for the subset of messages that only need the patient's name to make sense (a not-uncommon shape for a short re-engagement nudge).
Impact
- Retention/engagement: reduces silently-lost conversations where a patient went quiet and staff had no
in-product way to follow up over the clinic's primary chat channel.
- Consistency: uses the same messages, permissions, and communications log the rest of the clinic's WhatsApp
system already relies on — this isn't a parallel system to maintain.
- Scope is deliberately narrow. This does not open up general-purpose "send anything, anytime" WhatsApp messaging
outside the 24-hour window — that's not something Meta's platform allows regardless of what Dentolize builds. The restriction to name-only messages is a hard technical boundary, not a soft first-version limitation.
Risk
- Blast radius is small. The change is additive: one new mutation, one new query argument, two new UI entry
points, all gated behind the existing SEND_WA permission. It doesn't touch the normal (non-expired) messaging path at all.
- Failure mode is visible, not silent. If WhatsApp rejects the send (bad template, disconnected account, invalid
number), the attempt is still logged to the communications log with the failure reason (packages/server/src/resolvers/mutations/actions/officialWhatsApp/sendWhatsappTemplate.js:113-141), and the error surfaces to the user immediately rather than failing silently in the background.
- Depends on external state Dentolize doesn't control: a clinic needs (a) an active Meta/WhatsApp Business
connection and (b) at least one Meta-approved template attached to a message before this feature has anything to send. Clinics without either will simply see an empty picker or a connection error — this is expected, not a bug.
- One incidental change bundled in: this PR also reformats (not behaviorally changes) a block of DHS-integration
permission rules in packages/server/src/permissions/permissions.js for line-length, and reorders some import statements alphabetically. That's unrelated code hygiene riding along with the feature commit, not a DHS behavior change — worth knowing about if this PR is being reviewed line-by-line and DHS-related diff lines look unexpectedly large.
What "done" looks like for this PR
A staff member with WhatsApp permissions can open any expired conversation, on either web or mobile, and send an already-approved, name-only message into it — with the send failing loudly and specifically (not silently) if any precondition isn't met.