Templates and variables
Attach WhatsApp and email templates to a notification rule, match template placeholders to event values, format dates and amounts, and add send conditions.
Each notification rule names the templates it sends and decides how the event's values fill them in. This page covers the template fields, the values an event provides, and the three sections that shape a message: Template names, Dates, amounts & wording and Only send when. It is for administrators who set up Notification rules.
How a message is built
From event to message
- 1
Collect the event's values
Every event provides
patient_name,doctor_nameandcentre_nameplus the values it carries, such asslot_dateorbill_number.Outpatient_namedoctor_namecentre_name and the event's own values - 2
Format them
The built-in formats apply unless the rule changes them.
InDatesamounts & wordingOutreadable datesamounts in rupeeslabels instead of codes - 3
Check the conditions
Every check must pass on the formatted values.
InOnly send whenOn failure: nothing is sent on any channel
- 4
Rename for the template
Values are renamed to the placeholder names each template expects.
InTemplate names - 5
Send on each channel
The finished values fill the template for each channel on the rule.
InWhatsApp Template IDEmail TemplateEmail Identity
Choose the templates
In the Staff or Patient section of a rule:
Field | How to fill it |
|---|---|
WhatsApp Template ID | Type the numeric ID of an approved WhatsApp template ("WABA template ID"). |
Email Template | Pick from your organisation's email templates. "No email templates found" means none exist yet. |
Email Identity | Pick the verified sender address. "No verified identities found" means none is verified yet. |
WhatsApp templates, email templates and sender identities are created outside LeapHealthOS. Your implementation team gives you the template IDs and sets up senders.
If a WhatsApp template has a document header, the rule automatically sends the event's pdf_url as that document, so the Bill Issued and Bill Paid events can send the invoice or statement PDF. For email, pdf_url is attached when the event has one.
The template check
Once a template is chosen, the section checks it against the event ("Checking template vars..."). For each channel it shows the template name and a chip for each placeholder the template needs. Missing ones are highlighted and listed as "Not sent by this event: ...". The line "N values from this event can be used in the message." tells you how many values you can map. "This event is not in the catalog, so its variables cannot be checked." means LeapHealthOS cannot check this event; test it by triggering the event.
A template placeholder that nothing fills usually stops the message being delivered, so fix every missing name before you rely on the rule.
Values you can use
Every event provides:
patient_name,doctor_name(the event's primary doctor, if any),centre_name;- the values the event carries, for example
slot_date,slot_start_time,amount,booking_reference,bill_number,token_number,queue_name,position_in_queue,payment_link_url,pdf_url,rule_name,severity.
The template check shows the exact values for the event you are editing. The main ones per event are described in Notification events and recipient strategies.
Staff messages cannot show the patient's name
In a Staff message, patient_name contains the name of the staff member who receives the message. Leave patient_name out of staff templates, or use it only as a greeting to the recipient.
Built-in formats
These apply on every rule unless you change them.
Values | Shown as |
|---|---|
Dates: |
|
Times: |
|
Date and time: |
|
| The matching amount in rupees. The plain |
| The last part of |
| A readable label, for example |
Times are shown in the Asia/Kolkata timezone unless you change it.
Use the rupee values for money
amount, total_amount and the other plain amounts are in paise (₹500 is sent as 50000). Map amount_rupees or total_amount_rupees into your template instead.
Dates, amounts & wording
Open Dates, amounts & wording in a section to change how values look for this rule only. The header says "Using clinic defaults" until you change something, then "Edited for this rule".
- Defaults for this rule: Timezone, Date, Time and Date & time patterns. "Used for every date and time here unless a value below says otherwise."
- Change how a value looks: pick an existing value and change its format. Each value shows an example.
- Add a value: create a new value from an existing one. Give it a Value name (lowercase letters, numbers and underscores), choose what it Comes from and how it Shows as.
Shows as | Options |
|---|---|
Date & time | Show the date as (for example |
Number | Multiply by, Divide by, Add and Decimals, applied in that order. Leave blank to send the number unchanged. |
Word replacement | Pairs of Original value and Show instead, for example |
Link name | The last part of a web link. |
Example: to show the appointment date as "05 Jan 2026" in one rule, open Dates, amounts & wording, choose Change how a value looks, pick slot_date and set Show the date as DD MMM YYYY. Use Reset to default to undo.
A value cannot change its kind. For example you cannot turn a date into a Word replacement; the save is refused.
Template names
Your template may use different placeholder names from LeapHealthOS, for example name instead of patient_name. Open Template names in the section. For WhatsApp and Email separately, add a row with Add a name: pick Our value and type what the Template expects.
- Renaming replaces our name; the value is no longer sent under the old name.
- The header shows how many names are renamed, or "Needs attention" with the number still unmapped.
- If you rename
pdf_urlfor email, the PDF is no longer attached.
Only send when
Open Only send when to add conditions to the whole rule. "Every check has to pass or the message is skipped on all channels, with nothing recorded as a failure. Leave this empty to always send."
Click Add a check and choose:
- Value: which event value to check.
- Check: is, is not, is greater than, is greater than or equal to, is less than, is less than or equal to, has a value, does not have a value.
- Value type and Compared to: Text, Number or Yes / No, and the value to compare with.
Checks run on the formatted values, so compare against what the message would show.
Goal | Check |
|---|---|
Only tell the patient about counter payment |
|
Skip zero-value bills |
|
Only when there is a payment link |
|
Watch for the warnings under each check: "is not sent by this event, so this check may never pass" and "is not a number, so this check is always false and nothing sends". An empty value counts as "does not have a value".
When a message does not arrive
LeapHealthOS does not show whether a message was delivered. Work through this list:
- Is there a rule for this event, audience and centre (or organisation), with at least one channel? See Notification rules.
- Did the strategy find anyone? See Notification events and recipient strategies.
- Does the recipient have a phone number (WhatsApp) or email address (Email) on their record?
- Is a WhatsApp Template ID set, or both Email Template and Email Identity?
- Did an Only send when check fail?
- Are all template placeholders mapped?
- Is the channel SMS or Push? Neither works from this screen.
Related pages
Last updated on
Notification events and recipient strategies
Every event you can set a notification rule for, when it happens, and exactly which staff each recipient strategy reaches, including overrides.
Appointment reminders
How LeapHealthOS sends one scheduled reminder before each appointment, how to send one by hand, and what you need to set up for reminders to reach patients.