WhatsApp Business Account Setup
Mazecare integrates with the Meta WhatsApp Business API to automate patient communications. This guide details how to configure your WhatsApp Business Account (WABA) credentials, sync message templates, and wire automated notifications directly into Workflow Definition state machines.
Detailed Step-by-Step Walkthrough
Step 1: Retrieve Meta API Credentials
Before configuring Mazecare, set up your WhatsApp Business application in the Meta Developer Console:
- Log in to the Meta for Developers Portal.
- Create or select a Business App and set up the WhatsApp integration.
- In the left menu, go to WhatsApp > API Setup.
- Retrieve and copy the following parameters from the credentials panel:
- Phone Number ID
- WhatsApp Business Account ID
- Access Token (We recommend generating a Permanent System User Access Token in your Meta Business Suite settings for production use, rather than a temporary token).
Step 2: Configure WABA Credentials in Mazecare
Link your Meta WhatsApp Business app details to the Mazecare settings panel:
- Log in to Mazecare as an Administrator.
- Navigate to WhatsApp Integration settings (
/settings/whatsapp) using the WABA table (waba-table.vue). - Click Register WABA to open the registration form (
waba-register-form.vue/waba-register-guide.vue):- Paste your Phone Number ID into the Phone ID field.
- Paste your WhatsApp Business Account ID into the Business Account ID field.
- Paste your Access Token into the Token field.
- Click Verify & Save Credentials (
waba-object-layout.vue). The system performs a handshake test with the Meta API and creates a WABA record.
Step 3: Sync Approved Message Templates
To start sending messages, sync and map your Meta-approved templates to clinical events:
- Create and submit message templates (e.g., Booking Confirmations, Digital MC links, Invoice receipts) for approval in your Meta Business Manager > WhatsApp Manager.
- Once approved, return to Mazecare and navigate to Message Templates (
/settings/whatsapp/[wabaId]/message-templatesusingwaba-message-templates.vueandwaba-message-template-table.vue). - Click Sync Templates to download approved templates from Meta.
- Open the template mapping drawer (
waba-message-template-slideover.vueorwaba-message-template-create-form.vue):- Map each approved Meta template to the corresponding clinical trigger in Mazecare (e.g., mapping
booking_confirmationto the Appointment Scheduled trigger). - Map variable placeholders like
{{1}},{{2}}to patient/clinic parameters (e.g.,{patient_name},{appointment_date}, or{receipt_link}).
- Map each approved Meta template to the corresponding clinical trigger in Mazecare (e.g., mapping
- Click Apply Template Routing to save the configuration.
Step 4: Integrate WhatsApp Notifications into Workflow Definitions
To automate delivery, wire the synchronized templates into your clinical workflows:
- Navigate to Settings → Workflow Definitions (
/settings/workflow-definitions) and open your active workflow. - In the Editor tab (
workflow-definition-editor.vue), select the target state node or transition edge where you want to send a notification (e.g., select the Registration state's entry hook, or the transition from Consultation to Completed). - In the side properties panel, add an HTTP Action (
workflow-http-action.vue):- Name: e.g., "Send Booking Confirmation".
- Method:
POST - URL: Set to the WhatsApp delivery endpoint (or the system's GraphQL mutation endpoint).
- Payload: Configure the mutation body in GraphQL or raw JSON mode.
- Liquid Templating: Use Liquid-style template interpolation to inject context variables dynamically (e.g.,
{{workflowContext.whatsAppTemplateName}},{{workflowContext.whatsAppPhoneNumberId}}, and the patient's phone number).
- Asynchronous Sub-Workflows:
- For complex patient notifications (like sending multi-stage reminders), you can link states to a dedicated WhatsApp notification sub-workflow (
subWorkflowDefinitionId). - When the parent workflow enters that state, it spawns the notification sub-workflow asynchronously. This executes all message dispatches in the background without blocking the primary clinical queue or physician encounters.
- For complex patient notifications (like sending multi-stage reminders), you can link states to a dedicated WhatsApp notification sub-workflow (
Admin & Workplace
Guidelines for generating specialist referral letters and completing pre-employment medical checks using EMR structured questionnaires.
Maze.care Listing
How to configure and list your branches, doctors, service offerings, and appointment schedules on the public Maze.care directory to enable patient self-booking.