Articles on: Message Templates

How to Personalize Templates using Variables?

You can personalize your Message Templates using variables and send customer-specific data in the message when sending your Notifications.



Variables (also known as merge tags) in message templates work in a slightly different way from how it usually works at other places like email templates.


In case of WhatsApp, it’s a two step process:


Step 1 – Create Message Template with Variable Placeholders


Create a Message Template with variable placeholders like {{1}}, {{2}}, {{3}} and so on within your content wherever you want the dynamic content to come. For example Body content can be personalized like this:


Hello {{1}}.Your order number is {{2}}. Thank you for placing your order.
  • Team YourStore

  • ****You can also personalize your button links by putting your link this way in button's Website URL field like this:


    https://yourwebsite.com/tracking/{{1}}


    Note for button links: You can **add a maximum 1 variable ** to button links {{1}} and it must be added at the end of the URL as shown in the example above. You can not add more than 1 variable in the button URL or put it anywhere else other than at the end of the URL.


    If you’re coming from email marketing background, this process of setting up variables might look different from how it’s usually done. But as the template is sent to WhatsApp for approval, this is how they’ve made it to simplify the process. If you'd like to learn more about message templates, checkout our article here.


    Step 2 – Create Notification and do Variable Mapping


    Now that you've setup variable placeholders, let's look at how to map those with actual data when sending a Notification.. After creating the message template, the next step is to create a Notification and selecting the Message Template.


    After you select the template you get the option to map the variables ({{1}}. {{2}}, {{3}} and so on) in the selected message template with actual data like First Name, Last Name, Phone Number, custom contact attributes, data fields from trigger (in case of transactional notifications) and so on under the Value column.


    You can also add Fallback Value for each variable for cases when data from the actual Value field might come empty. For such cases the system will take value from the Fallback Value column.

    Updated on: 16/12/2024

    Was this article helpful?

    Share your feedback

    Cancel

    Thank you!