Creating WhatsApp Templates with Variables
Variables can be used on all templates built on Maqsam. There are a few differing rules for variables sent in a message.
For templates sent out through WhatsApp the following rules apply:
1- Variables need to be created and used in sequential order. For example, Meta does not allow {{1}} words {{3}} but they allow {{1}} words {{3}} words {{2}}.
Not Allowed: "body": "Hi {{1}}, Your flight will depart from gate {{3}}. Please reply Stop to unsubscribe."
Allowed: "body": "Hi {{1}}, Your flight will depart from gate {{2}}. Please reply Stop to unsubscribe."
2- Variables cannot be right next to each other without a sample or an example. Meta considers variables separated only by a space as next to each other. There additionally needs to be characters separated by a space between variables.
Example that would need a sample: "body": "Hi {{1}} {{2}}, flight will depart from gate {{3}}. Please reply Stop to unsubscribe."
Example that would not need a sample: "body": "Hi {{1}} and {{2}}, flight will depart from gate {{3}}. Please reply Stop to unsubscribe."
3- Variables cannot be the start or end of a body string without a sample. Meta considers variable strings ending in a variable + punctuation as a variable at the end of a string. There will need to be extra text after the variable.
Example that would need a sample: "body": "Hi {{1}}, flight will depart from gate {{2}}."
Example that would not need a sample: "body": "Hi {{1}}, flight will depart from gate {{2}}. Please reply Stop to unsubscribe."
4- Templates cannot have too many variables relative to the message length. The general rule observed for this is for every 'x' variable there needs to be 2x+1 non variable words. For examples, For 2 variables, you need 5 non-variable words.Words being defined as characters separated by a space. There is also a limit of 100 variables per template.
Not Allowed: "body": "Hi {{1}}, gate {{2}}. Thank you."
Allowed: "body": "Hi {{1}}, Your flight will depart from gate {{2}}. Thank you."
5- Variables do allow for non-numeric variables. Variable names cannot have spaces
Not allowed: {{id name}}
Allowed: {{IdName}}
6- Template Body: Enter the content of your message. Make sure it follows WhatsApp’s guidelines for templates. When you copy the template content, from anywhere, and paste it in the body - Add the variables by clicking on the “add variable button”
- The variables will be added at the end of the text
- Copy each variable and paste it in the intended place
Related Articles
Creating WhatsApp Message Templates in Maqsam Admin Portal
In this article, we’ll guide you through the process of creating WhatsApp message templates directly from your Settings in Maqsam. Follow these steps to manage your templates effectively. What is a WhatsApp Template? A WhatsApp template is a ...
WhatsApp Business Conversations
WhatsApp Conversations allow Agents to send and receive messages to interact with clients on a timely basis, using user-initiated and business-initiated messages. WhatsApp lists allow creating marketing campaigns to include more than one contact to ...