Using Template Variables

When editing client-side templates, email notifications, or saved replies, you can customize them with dynamically inserted template variables.

User variables

The user object is available in all templates and it consists of these properties:

{
     "id": "2",
     "date_added": "2020-12-01T13:00:00+0000",
     "name_f": "Kevin",
     "name_l": "Malone",
     "email": "kevin@dundermifflin.com",
     "company": null,
     "tax_id": null,
     "phone": null,
     "address": null,
     "note": null,
     "balance": "0.00",
     "optin": null,
     "stripe_customer_id": null,
     "custom_fields": {},
     "status": "lead"
 }

You can show the value of any of these properties like this:

{{ user.email }}
{{ user.custom_fields.123 }}

Order variables

The order object is available in your saved replies and many email templates (click “variable reference” next to the email subject to see a list of available variables). The order object has these properties:

{
     "id": "D324B7A3",
     "date_added": "2020-12-01T13:00:00+0000",
     "date_updated": null,
     "date_started": null",
     "date_completed": null,
     "date_due": null,
     "status": "Pending",
     "price": "0.00",
     "options": null,
     "currency": "USD",
     "paysys": null,
     "service": "Simple Service",
     "service_id": "1",
     "user_id": "2",
     "employee": null,
     "note": null,
     "tags": null,
     "subscription": null,
     "form_data": null
 }

Similar to the user object, you can access the value of any of these properties like this:

{{ order.id }}
{{ attribute(order.form_data, 'Your website URL') }}

Submitted form data contains an array of field names with their values. To access a fields value when there’s a space in its name you can use the attr() function as shown above.

Conditional logic

To create more advanced conditional logic in your templates you can use an if/else structure:

{% if order.status == 'Complete' %}
    <p>Your order is complete</p>
{% else %}
    <p>Your order is in progress</p>
{% endif %}
Updated over a month ago

Thanks for your feedback 🙏

Was this helpful?