Dynamic Variables in Re:amaze Automated Responses

Re:amaze supports certain dynamic variables for Response Templates, Email Autoresponders, and Workflow Responses. Variables are related to the customer associated with the conversation context and further variables are made available depending on integrations that you've enabled in your account.

Dynamic Variables are based on Liquid and can be used with simple logical statements. Please refer to the Liquid documentation for advanced template usage.

Basic Variables

Brand

  • {{ brand.name }} -- The name of the current Brand. Useful when a Workflow or Response Template is shared across multiple Brands.

Customer

  • {{ customer.name }} -- The full name of the customer.
  • {{ customer.friendly_name }} -- The "friendly name" of the customer. This defaults to the first token in the customer's name, which works for names with an English origin. Otherwise, you can also change the friendly name of a customer under the contact page.
  • {{ customer.email }} -- The email of the customer. Available only when the conversation context is Chat or Email.
  • {{ customer.data["ATTRIBUTE"] }} - The value of the custom data attribute named ATTRIBUTE. Replace the variable with your customer attribute key of choice.

Conversation

  • {{ thread_url }} -- A permalink to the conversation.
  • {{ fields["ATTRIBUTE"] }} -- Custom field values.
  • {{ ref_id }} -- Conversation reference ID (available by request only).

Staff

Note that staff variables are only relevant for response templates.

  • {{ staff.name }} -- The full name of the staff user.
  • {{ staff.friendly_name }} -- The "friendly name" of the staff user. This defaults to the first token in the staff user's name, which works for names with an English origin.
  • {{ staff.email }} -- The email of the staff user. Available only when the conversation context is Chat or Email.
Integration Variables

Integration Variables are only made available when you have integrations connected with Re:amaze. Also, integration variables are actually nested attributes, so there is a lot of data made available conditional to what's made available via the third-party integration API. The listed variables below are just a sample of what's made available. You can use any variable available from the source integration API docs.

Shopify Variables

  • Order information. Accessible values are completely based on the Shopify Order Resource
    • {{ integrations.shopify.orders[0].id }} -- ID of the last order
    • {{ integrations.shopify.orders[0].order_number }} -- Number of the last order
    • {{ integrations.shopify.orders[0].name }} -- Name of the last order
    • {{ integrations.shopify.orders[0].order_status_url }} -- Status URL for the last order
    • {{ integrations.shopify.orders[0].fulfillments[0].tracking_url }} -- Tracking URL of the last order
    • {{ integrations.shopify.orders[0].fulfillments[0].tracking_number }} -- Tracking number of the last order
    • {{ integrations.shopify.orders[0].fulfillments[0].created_at }} -- Date fulfilled
    • {{ integrations.shopify.orders[0].shipping_methods[0].title }} -- Last shipping method used
    • {{ integrations.shopify.orders[0].refunds[0].processed_at }} -- Last refund date on the last order
    • {{ integrations.shopify.orders[0].line_items[0].name }} -- Product name on the last order
    • {{ integrations.shopify.orders[0].line_items[0].variant_title }} -- Product variant on the last order
    • {{ integrations.shopify.orders[0].refunds[0].processed_at }} -- Refund process date on the last order
  • Customer Information. Accessible values are completely based on the Shopify Customer Resource
    • {{ integrations.shopify.customer.last_order_name }} -- The name of the customer's last order.
    • {{ integrations.shopify.customer.note }} -- A note about the customer.
    • {{ integrations.shopify.customer.orders_count }} -- The number of orders associated with this customer.
    • {{ integration.shopify.customer.total_spent }} -- The total amount of money that the customer has spent across their order history.
    • {{ integrations.shopify.customer.default_address.address1 }} -- The first line of the customer's mailing address.
    • {{ integrations.shopify.customer.default_address.address2 }} -- An additional field for the customer's mailing address.
    • {{ integrations.shopify.customer.default_address.city }} -- The customer's city, town, or village.
    • {{ integrations.shopify.customer.default_address.province }} -- The customer's region name. Typically a province, a state, or a prefecture
    • {{ integrations.shopify.customer.default_address.zip }} -- The customer's postal code, also known as zip, postcode, Eircode, etc.
    • {{ integrations.shopify.customer.default_address.province_code }} -- The two-letter code for the customer's region.
    • {{ integrations.shopify.customer.default_address.country_code }} -- The two-letter country code corresponding to the customer's country.
    • {{ integrations.shopify.customer.default_address.country_name }} -- The customer's normalized country name
  • Shopify allows customers and orders to contain meta-fields. Re:amaze supports metafields for the customer and the latest order for that customer. To access these values, you can use syntax similar to the following.
    • {{ integrations.shopify.customer.metafields.namespace.Key }} -- Customer's metafields
    • {{ integrations.shopify.orders[0].metafields.namespace.Key }} -- Metafields on the last order

Bigcommerce Variables

  • Order information. Accessible values are completely based on the BigCommerce Order Resource
    • {{ integrations.bigcommerce.orders[0].id }} -- ID of the last order
    • {{ integrations.bigcommerce.orders[0].status }} -- Status of the last order
    • {{ integrations.bigcommerce.orders[0].date_shipped }} -- Date Shipped
  • Shipment information. Accessible values are completed based on the BigCommerce Shipment Resource
    • {{ integrations.bigcommerce.latest_tracking.tracking_number }} -- Tracking number of the last order
    • {{ integrations.bigcommerce.latest_tracking.shipping_method }} -- Shipping method of the last order
    • {{ integrations.bigcommerce.latest_tracking.tracking_url }} -- Tracking URL of the last order
    • {{ integrations.bigcommerce.latest_tracking.tracking_carrier }} -- Tracking Carrier

Woocommerce Variables

  • {{ integrations.woocommerce.orders[0].id }} -- ID of the last order
  • {{ integrations.woocommerce.orders[0].number }} -- Number of the last order
  • {{ integrations.woocommerce.orders[0].refunds[0].total }} -- Last refund amount on the last order
  • {{ integrations.woocommerce.orders[0].tracking_link }}-- Tracking link for last order
  • {{ integrations.woocommerce.orders[0].tracking_number}}-- Tracking number for last order

ReCharge Variables

  • {{ integrations.recharge.customers[0].id }} -- ID of the customer in ReCharge
  • {{ integrations.recharge.customers[0].hash }} -- Hash of the customer in ReCharge. Can be used to generate the secure subscription management URL.

Smile.io Variables

  • {{ integrations.smileio.customers[0].id }} -- ID of the customer in Smile.io
  • {{ integrations.smileio.customers[0].points_balance }} -- The customer's points balance
  • {{ integrations.smileio.customers[0].state }} -- The customer's current state (member, candidate, disabled)
  • {{ integrations.smileio.customers[0].created_at }} -- The date the customer was created in Smile.io

Notes on usage

Because of the complex nature of integration variables, some values may not exist. We recommend using logical statements to work around these cases. That is, before using a variable it's highly recommended to check for its existence as in the simple example below:

{% if integrations.shopify.orders and integrations.shopify.orders[0].order_status_url %}
  Some text including {{ integrations.shopify.orders[0].order_status_url }}
{% else %}
  Something that doesn't include the variable, since it's not available.
{% endif %}

The more complete example below is a sample of how logical statements can be used to generate a response, which can be used a starter template for your own situation:

Shopify

Hi {{ customer.friendly_name }},

{% if integrations.shopify.orders and integrations.shopify.orders != empty -%}
Here is shipping information related to your last order:

Order #: {{ integrations.shopify.orders[0].order_number }} 
Status URL: {{ integrations.shopify.orders[0].order_status_url }}
{% if integrations.shopify.orders[0].fulfillments[0].tracking_number -%}
Tracking number: {{ integrations.shopify.orders[0].fulfillments[0].tracking_number }}
Tracking URL: {{ integrations.shopify.orders[0].fulfillments[0].tracking_url }}
{%- endif -%}
{%- else -%}
We don't have any records of recent orders. Please let us know if you placed your order under a different email address than {{ customer.email }}
{%- endif  %}

Thanks!

BigCommerce

Hi {{ customer.friendly_name }},

{% if integrations.bigcommerce.orders and integrations.bigcommerce.orders != empty -%}
Here is shipping information related to your last order: 

Order #: {{ integrations.bigcommerce.orders[0].id }} 
Status: {{ integrations.bigcommerce.orders[0].status }}
{% if integrations.bigcommerce.latest_tracking.tracking_number -%}
Tracking number: {{ integrations.bigcommerce.latest_tracking.tracking_number }}
Tracking URL: {{ integrations.bigcommerce.latest_tracking.tracking_url }}
{%- endif -%}
{%- else -%}
We don't have any records of recent orders. Please let us know if you placed your order under a different email address than {{ customer.email }}
{%- endif  %}

Thanks!