Add Variables to Proactive WhatsApp Scripts
You can use dynamic variables in your script. Variables can enable you to include custom information in your messages. To do so, add a Snippet action between the BEGIN and ASSIGN actions. These variables can be added to the default script or to a custom script you create in Studio.
You do not have to use variables to your Proactive WhatsApp script. The use case that follows shows just one example. Snippets are a more advanced Studio technique. If you plan to use snippets, the Studio technical reference guide provides detailed information about scripting in snippets.
Mary Reilly is the shipping manager for Classics, Inc., an online bookseller. She uses Proactive WhatsApp to send shipping notifications to customers. Mary decides to add a variable to her message template so she can refer to the buyer by their first name. She can pull this information directly from her calling list, which she generates from each day's shipments.
Mary logs in to Studio and opens her Proactive WhatsApp call suppression script. After adding a Snippet action, she edits the action to use the following script:
DYNAMIC vars
vars[1] = _prospectiveContact.custominfo.first_name.$Value
ASSIGN global:TemplateVars = "{vars.asjson()}"
This script automatically pulls the first name for each buyer into the message template. After testing, Mary likes the results so well that she wants to include the order number and tracking number in her template as well. Because this information is not in her calling list, she works with her experienced Studio team to do so.