Skip to main content
A variable is a placeholder in a message, such as {{ customer.first_name }}, that Pocketflows replaces with a real value when the message is sent. Variables are how one email or SMS reads as if it were written for each person who receives it. For the full list of names, see Variables.

Where the values come from

You do not create variables. They come from the data that is already in Pocketflows, most of which you put there: So the way to offer a new variable is to sync or track a new piece of data. If you add next_appointment to a customer’s metadata, businesses can write {{ customer.next_appointment }}. If you send service in an event’s data, a trigger for that event can use {{ event.service }}. This is the same data that powers segments. A property you sync once can be both a filter a business segments on and a variable it writes into a message. See How segments and filter definitions work.

Filled in per recipient, at send time

A variable is filled in separately for every recipient, at the moment each message is sent. Two consequences follow:
  • A message always uses the current value. If a customer’s metadata changes between when a campaign is written and when it is sent, the new value is used.
  • business. variables are the same for every recipient of one business, while customer. variables differ for each one. This is why a template shared across businesses can still mention each business by name.

How businesses find variables

In the embed, a business picks from a list of variables rather than typing names from memory. Pocketflows builds that list by looking at the business’s own data: the business’s metadata, and the properties and metadata found on a sample of its customers. Because the customer list is built from a sample and refreshed periodically, a metadata key you start syncing may not appear in the list for up to an hour. A key that only a few customers have may not appear at all, although it still works if typed.

When a value is missing

If a message uses a variable and the recipient has no value for it, Pocketflows does not send that message to that recipient. It does not send the message with a blank in it. For campaigns and triggers, the message is retried about once a day, and sent as soon as the value exists. After five failed attempts, it is abandoned for that recipient. Other recipients are not affected. This makes variables safe to use, and it also means a variable should only be used when every intended recipient has a value. If only some customers have a next_appointment, send that message to a segment of the customers who do.