1. Help Center
  2. Template Manager

How are variables used in WhatsApp Message Templates?

In WhatsApp message templates, variables are used to personalize messages by inserting dynamic content. They act as placeholders that are replaced with actual data when the message is sent.

For example:

Consider a template: "Hello " {{ 1 }}" , your order " {{ 2 }}" is confirmed. We'll notify you when it ships."

Variables:

  1. " {{ 1 }}" - User's name
  2. " {{ 2 }}" - Order number

So, if the user's name is Sara and the order number is #12345, the message sent would be: "Hello Sara, your order #12345 is confirmed. We'll notify you when it ships."

 

Why is Fallback value used in a message template?

A fallback value in WhatsApp message templates is a default content used when variable data is unavailable or encounters an error. You can provide a fallback value to ensure messages remain coherent and meaningful even if personalized information is missing. The fallback value acts as a backup to maintain a positive user experience.

For example,

consider a template: "Hello " {{ 1 }}", your appointment is scheduled for " {{ 2 }}"." If the user's name is not available (1 is empty), a fallback value like "Valued Customer" can be used to ensure that the message remains coherent: "Hello Valued Customer, your appointment is scheduled for "{{ 2 }}"."

In summary, a fallback value acts as a safety net, ensuring that the message remains meaningful even if specific variable data is unavailable.