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.

NOTE: When bulk-replying to customers, Response Templates containing variables will not be available. Only Response Templates that do not contain variables can be applied to bulk replies.

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 or workflow responses run as a staff user.

  • {{ staff.name }} -- The full name of the staff user.
  • {{ staff.display_name }} -- The "display name" of the staff user. Used for security and privacy.
  • {{ 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 and time fulfilled
    • {{ integrations.shopify.orders[0].shipping_lines[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.
    • {{ integrations.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 completely 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
  • Customer information. Accessible values are completely based on the BigCommerce Customer Resource
    • {{ integrations.bigcommerce.customer.email }} -- Customer's email
    • {{ integrations.bigcommerce.customer.first_name }} -- Customer's first name
    • {{ integrations.bigcommerce.customer.last_name }} -- Customer's last name
    • {{ integrations.bigcommerce.customer.phone }} -- Customer's phone number
    • {{ integrations.bigcommerce.customer.notes }} -- Customer notes

Woocommerce Variables

  • Order information. Accessible values are completely based on the WooCommerce Order Resource
    • {{ 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
  • Customer data. Accessible values are completely based on the WooCommerce Customer Resource
    • {{ integrations.woocommerce.customer.email }} -- Customer's email
    • {{ integrations.woocommerce.customer.first_name }} -- Customer's first name
    • {{ integrations.woocommerce.customer.last_name }} -- Customer's last name

ReCharge Variables

  • {{ integrations.recharge.customers[0].id }} -- ID of the customer in ReCharge
  • {{ integrations.recharge.customers[0].number_active_subscriptions }} -- Number of active subscriptions for the customer
  • {{ integrations.recharge.customers[0].hash }} -- Hash of the customer in ReCharge. Can be used to generate the secure subscription management URL, for example: https://storename.myshopify.com/tools/recurring/customers/{{ integrations.recharge.customers[0].hash }}/subscriptions

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

Stamped.io Variables
Please replace yourstore.myshopify.com with your actual store connected to Stamped.io:

  • {{ integrations.stampedio.customers[yourstore.myshopify.com].customer.points }} -- Customer's Stamped.io Points
  • {{ integrations.stampedio.customers[yourstore.myshopify.com].countReviews }} -- The customer's number of reviews
  • {{ integrations.stampedio.customers[yourstore.myshopify.com].countReferrals }} -- The customer's number of referrals
  • {{ integrations.stampedio.customers[yourstore.myshopify.com].customer.referralCode }} -- The customer's Stamped.io referral code
  • {{ integrations.stampedio.customers[yourstore.myshopify.com].customer.referralUrl }} -- The customer's Stamped.io referral url
  • {{ integrations.stampedio.customers[yourstore.myshopify.com].customer.sentimentScore }} -- The customer's sentiment score
  • {{ integrations.stampedio.customers[yourstore.myshopify.com].customer.dateBirthday }} -- The customer's birthdate

Formatting Dates

If you wish to format any Liquid timestamp, you can use a Liquid date filter.

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!

Contact Us

Not finding what you're looking for? Contact Us Directly