Mazecare Logo
Advanced Settings

WhatsApp Business Account Setup

How to link your WhatsApp Business API credentials to Mazecare to send patient appointment reminders, prescriptions, and digital MCs via Workflow Definitions.

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:

  1. Log in to the Meta for Developers Portal.
  2. Create or select a Business App and set up the WhatsApp integration.
  3. In the left menu, go to WhatsApp > API Setup.
  4. 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:

  1. Log in to Mazecare as an Administrator.
  2. Navigate to WhatsApp Integration settings (/settings/whatsapp) using the WABA table (waba-table.vue).
  3. 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.
  4. 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:

  1. Create and submit message templates (e.g., Booking Confirmations, Digital MC links, Invoice receipts) for approval in your Meta Business Manager > WhatsApp Manager.
  2. Once approved, return to Mazecare and navigate to Message Templates (/settings/whatsapp/[wabaId]/message-templates using waba-message-templates.vue and waba-message-template-table.vue).
  3. Click Sync Templates to download approved templates from Meta.
  4. Open the template mapping drawer (waba-message-template-slideover.vue or waba-message-template-create-form.vue):
    • Map each approved Meta template to the corresponding clinical trigger in Mazecare (e.g., mapping booking_confirmation to the Appointment Scheduled trigger).
    • Map variable placeholders like {{1}}, {{2}} to patient/clinic parameters (e.g., {patient_name}, {appointment_date}, or {receipt_link}).
  5. 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:

  1. Navigate to Settings → Workflow Definitions (/settings/workflow-definitions) and open your active workflow.
  2. 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).
  3. 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).
  4. 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.
Important Note
Ensure your Meta WhatsApp Business account is in good standing and has a valid payment method configured to prevent message delivery failures.
Copyright © 2026