Dynamic Variables

What are dynamic variables and how can I utilize them in Sonar?

Dynamic variables are customer attributes and properties that you can pull into your messages with just a simple line of code.

Customer Attributes

There are six default customer attributes that you can use in your messages that will pull in that attribute when the message is sent.

  • {{first_name}} - This will pull in whatever value is set for the customer's first name.
  • {{last_name}} - This will pull in whatever value is set for the customer's last name.
  • {{email}} - This will pull in whatever value is set for the customer's email address.
  • {{team_member_first_name}} - This will pull in the first name of the Sonar user that is currently assigned to the customer.
  • {{team_member_last_name}} - This will pull in the last name of the Sonar user that is currently assigned to the customer.
  • {{customer_phone_number}} - This will pull in the phone number of the customer.

Customer Properties

In addition to the attributes listed above, you can also pull in any Customer Properties currently in use on a customer record.

220

Example

Let's say you run an ice cream shop and you keep track of your customer's favorite ice cream flavor with the property called "icecream", you would use {{icecream}} in your message to pull in the value of that property into your message to that customer. We'll use customer attributes and properties described above to send a message to one of our customer's named Sarah whose favorite ice cream flavor is cotton candy.

Input
"Hey {{first_name}}! Your favorite ice cream flavor, {{icecream}}, is on sale this weekend. Come in, cool off, and treat yourself!"

Output

Hey Sarah! Your favorite ice cream flavor, cotton candy, is on sale this weekend. Come in, cool off, and treat yourself!

What if I don't know or don't have the customer name on file?

Great question! To account for a situation where you might not yet have the customer first name attribute to pull from, you can adjust the dynamic variable to something like this: {{first_name|there}}

This will pull in the first name if it exists, but if it does not exist, it will use the word behind the vertical bar in it's place. This is true for any dynamic variable (not just the first name attribute).

Input
"Hey {{first_name|there}}!"

Output

Hey there!

Where can I use dynamic variables?

Dynamic variables can be used anywhere in Sonar where you are composing a message. This includes Campaigns, Follow-Ups, Canned Responses, and Away Messages.

Are dynamic variables case sensitive?

If you are using a customer property as a dynamic variable, you'll need to make the spelling and case match your property exactly. If for some reason you happen to have two properties with the same name, but different capitalization, those are considered two different properties. Just make sure things match up and you'll be good!