In Pakistan, WhatsApp isn't just a messaging app — it's the primary communication channel for everything from business inquiries to patient follow-ups. For Dandaansaz, integrating WhatsApp wasn't optional — it was the difference between a system patients actually use and one they ignore. Here's the technical architecture behind the integration.
WhatsApp Business API Setup
We used the WhatsApp Business API (not the regular WhatsApp) for structured messaging. The setup required: a Meta Business account, phone number verification, message template approval (each template takes 24-48 hours for Meta to review), and a webhook endpoint for receiving messages. The key constraint: WhatsApp templates must be pre-approved and can't contain dynamic content in the header — only in the body variables. We designed 8 templates covering the full patient journey.
Pre-Filled Message Architecture
Each treatment page on the website has a 'WhatsApp Inquiry' button that opens WhatsApp with a pre-filled message. The message includes: treatment name, patient's auto-detected location, and a referral source (which page they came from). The pre-filled message routes to the correct team member based on treatment type — orthodontic inquiries go to the orthodontist's WhatsApp, cosmetic inquiries go to the cosmetic team. This routing is handled server-side before the WhatsApp URL is generated.
Note
WhatsApp pre-filled messages use the wa.me URL scheme: wa.me/PHONE?text=ENCODED_MESSAGE. The message must be URL-encoded, and special characters need careful handling.
Automated Reminder Pipeline
The reminder system runs as a daily cron job that checks for appointments in the next 7, 24, and 2 hours. For each appointment, it generates the appropriate reminder message, sends it via WhatsApp (or SMS as fallback), and logs the delivery status. If a patient doesn't confirm within 24 hours, the system flags it for staff follow-up. The pipeline is idempotent — running it twice doesn't send duplicate reminders.
Message Analytics and Tracking
Every WhatsApp interaction is logged: message sent, delivered, read, and replied to. We track which treatment pages generate the most WhatsApp inquiries, which messages get the highest response rates, and which patients haven't responded to reminders. This data feeds into the clinic's analytics dashboard, giving them visibility into their communication effectiveness without manually checking WhatsApp.
Conclusion
WhatsApp integration for healthcare isn't just about sending messages — it's about structuring communication so patients get the right message at the right time, and the clinic gets visibility into what's working. The technical investment in pre-filled messages, automated reminders, and analytics transformed WhatsApp from a black hole of scattered conversations into a trackable, optimizable communication channel.
Key Takeaways
- WhatsApp Business API requires pre-approved templates — design 8 templates covering the full patient journey
- Pre-filled messages with treatment context converted 3x better than generic contact buttons
- Automated reminder pipeline with idempotent execution prevents duplicate messages
- Message analytics provide visibility into communication effectiveness without manual checking