Template variables in workflow messages

You can customize the messages that you send from your workflows, so that they include references to your actual customers, orders, and products. For example, when a new customer is created, you can message your sales staff to send a welcome email to the new customer. You can include the customer's email address in this request, so your Sales staff don't need to look this up in your Shopify admin. To do this, you need to add template variables to your email message.

Template variables are placeholders that are replaced with actual values when a workfow runs. These variables describe the attributes of the customers, orders, and products that are involved in your workflows. For example, there are template variables for the order number, order price, customer name, and so on.

Whenever you edit an action that supports template variables, there are Add template variable links available underneath the text boxes:
A close-up of the workflow builder that shows the Send email action with the Add template variable link.
To add a template variable to a message click Add template variable and choose the one that you want from the suggested list:
A close-up of the workflow builder that shows the Send email action with the Add template variable link.

The template variables in the list are filtered, so that you only see ones that apply to the trigger that you've chosen. After you choose a variable from the list, it is properly formatted and added to the text box for you.

When your workflow runs, the template variables in your message are replaced with actual values from your store. The names of most template variables are self-describing. For example, the template variable that displays the name of the product is {{ product.title }}. When the email is sent, the variable will be replaced with the name of the ordered product: Large Coffee Mug.

Support for template variables in Shopify Flow

Template variables in Shopify Flow are roughly equivalent to the same named attributes of the Shopify Liquid objects (although there are some differences between them). You don't need to be familiar with Shopify Liquid to add template variables in Flow. You can rely on the Add template variables window to help you choose variables that will work for your workflow.

Want to discuss this page?

Visit the Shopify Community

Ready to start selling online with Shopify?

Try it free