Add variables to a WhatsApp template (customer name, appointment date) and map them

WhatsApp

How do I add a variable to a WhatsApp template?

Prerequisites: a linked official WhatsApp Business number. A variable is a part of the template filled in when the message is sent (such as the customer's name or the appointment date), and the easiest way is to create the notification template from the event itself.

The easiest way: a new template from the event (variables map themselves)

  1. Open the System section in the sidebar, then Manage notifications, and pick the WhatsApp Business tab.
  2. On the event (such as booking confirmation or the reminder) click Add template, then Create a new template.
  3. In Create template write the Message body, put the cursor where the detail should go, then click the variable under Available variables for this event (such as the customer name or the date). It is inserted in the text and added to the Variables list with a sample value.
  4. Fill in the rest and click Create template. Once WhatsApp approves it, it is linked to the event with every variable mapped to its detail, so you don't need to Bind positions by hand.

If you created the template from the templates page: click Add variable in Variables, type a name in lowercase English letters starting with a letter (such as customer_name) and a sample value, then click the variable to insert it. After approval link it to the event from Manage notifications (Add template → Use an approved template), then under Bind positions choose, for Position 1, Position 2…, the Mahjoz detail that fills it, and check the Preview. The mapping can't be saved until every position is mapped.

Why didn't pasting ready text work?

  • Don't type {{1}} and {{2}} yourself. The page only recognises variables written by name, such as {{customer_name}}, and turns them into position numbers itself when the template is submitted. Pasted numbers aren't recognised as variables. Delete them and insert the variable by clicking it.
  • If you paste text with a {{name}} you didn't define, you see These variables are used in the message but not defined; add it from Add variable with the same name, or delete it and insert it by clicking.
  • If you define a variable and don't use it, you see These variables are defined but not used in the message.
  • The text can't start or end with a variable; add a word before or after it.
  • Don't use Arabic-Indic digits (١, ٢) inside the braces.

In campaigns: creating a campaign shows a Personalize message step; for each variable choose Field (such as their name) with a fallback for when the field is empty, or Static text shown to every recipient.

If a customer received a message with a position number instead of the detail, that position isn't mapped; open the event in Manage notifications, click Edit and map it. This is set up from the dashboard only.

Sell anything.Run everything.Grow every customer.

  1. WebsiteFor your customers

  2. DashboardFor you

  3. Staff appFor your team

  4. POSFor your team

  5. Customer appFor your customers

Run your whole business on one platform. Talk to our sales team and we'll show you Mahjoz working the way it would in your business.

  • Free demo
  • No commitment
  • No commission on your sales

+966 58 150 4066 · info@mahjoz.io