Skip to main content
All CollectionsIntegrationsBigCommerceCampaigns and transactional email
Variables for transactional email templates in BigCommerce
Variables for transactional email templates in BigCommerce

Learn which variables you can use in your customer and order transactional email templates for BigCommerce.

Gareth Burroughes avatar
Written by Gareth Burroughes
Updated over 9 months ago

This reference document lists all the variables that are available for BigCommerce transactional email campaigns.


Before you start

Things you need to know:

  • You need to use the variable, {{data}}, to access the customer and order objects for your transactional email sends.


Subject line variables

You can only use three variables in the subject line of your transaction email template:

  • @FIRSTNAME@
    Inserts the first name of your contact.

  • @LASTNAME@
    Inserts the last name of your contact.

  • @ORDER_ID@
    Inserts the order ID based on your contact’s purchase.

You can’t use other variables in your subject lines.


Customer variables

You can find code that’s available for New account confirmation campaigns below, including examples.


Customer data variables

The {{ data.customer }} variables are:

  • {{ data.customer.id }}
    Returns the ID of the customer.

  • {{ data.customer.email }}
    Returns the email address of the customer.

  • {{ data.customer.first_name }}
    Returns the first name of the customer.

  • {{ data.customer.last_name }}
    Returns the last name of the customer.

  • {{ data.customer.news_letter_subscription }}

    • Returns true if the customer consents to receiving a newsletter subscription.

    • Returns false if the customer hasn’t consented to receiving a newsletter subscription.

  • {{ data.customer.created_time }}
    Returns the date and time a customer was created. For example, 2020-07-08T14:27:44.

  • {{ data.customer.modified_time }}
    Return the date and time a customer was updated. For example, 2020-07-08T14:27:44.

  • {{ data.customer.company }}
    Returns the company name that was left by the customer.

  • {{ data.customer.phone }}
    Returns the phone number of the customer.

  • {{ data.customer.orders_count }}
    Returns the number of total orders a customer has at the time. For example, 2.0 .

  • {{ data.customer.note }}
    Returns any notes left by the customer.


Customer billing address variables

The {{ data.customer.billing_address }} variables are:

  • {{ data.customer.billing_address.Id }}
    Returns the ID of the billing address.

  • {{ data.customer.billing_address.type }}
    Returns the address billing type. For example, Billing.

  • {{ data.customer.billing_address.first_name }}
    Returns the first name of the customer.

  • {{ data.customer.billing_address.last_name }}
    Returns the last name of the customer.

  • {{ data.customer.billing_address.postcode }}
    Returns the billing address post code.

  • {{ data.customer.billing_address.address1 }}
    Returns the first line of the billing address.

  • {{ data.customer.billing_address.address2 }}
    Returns the second line of the billing address.

  • {{ data.customer.billing_address.phone }}
    Returns the phone number of the customer.

  • {{ data.customer.billing_address.city }}
    Returns the billing address city.

  • {{ data.customer.billing_address.country }}
    Returns an array of the billing address country.

  • {{ data.customer.billing_address.country[0].code2 }}
    Returns the billing address alpha-2 country code. For example, GB.

  • {{ data.customer.billing_address.country[0].code3 }}
    Returns the billing address alpha-3 country code. For example, GBR.

  • {{ data.customer.billing_address.country[0].name }}
    Returns the billing address country name. For example, United Kingdom.

  • {{ data.customer.billing_address.state }}
    Returns an array of the billing address state.

  • {{ data.customer.billing_address.state[0].code }}
    Returns the billing address state in code format. For example, AZ for Arizona.

  • {{ data.customer.billing_address.state[0].name }}
    Returns the billing address state in code name format. For example, Arizona

  • {{ data.customer.billing_address.company }}
    Returns the company name.

  • {{ data.customer.billing_address.default }}
    Returns the default billing address. For example, true or false.

The default customer billing address attribute stores addresses that a customer enters where one is the default.


Customer shipping address variables

The {{ data.customer.shipping_address }} variables are:

  • {{ data.customer.shipping_address.Id }}
    Returns the customer shipping address ID. For example, 8.

  • {{ data.customer.shipping_address.type }}
    Returns the customer shipping address type. For example, Shipping.

  • {{ data.customer.shipping_address.first_name }}
    Returns the customer shipping address first name.

  • {{ data.customer.shipping_address.last_name }}
    Returns the customer shipping address last name.

  • {{ data.customer.shipping_address.postcode }}
    Returns the customer shipping address post code.

  • {{ data.customer.shipping_address.address1 }}
    Returns the first line of the customer shipping address.

  • {{ data.customer.shipping_address.address2 }}
    Returns the second line of the customer shipping address.

  • {{ data.customer.shipping_address.phone }}
    Returns the customer shipping phone number.

  • {{ data.customer.shipping_address.city }}
    Returns the customer shipping address city.

  • {{ data.customer.shipping_address.country }}
    Returns an array of the customer shipping address country.

  • {{ data.customer.shipping_address.country[0].code2 }}
    Returns the customer shopping address country in version two format. For example, GB.

  • {{ data.customer.shipping_address.country[0].code3 }}
    Returns the customer shipping address country in version three format. For example, GBR.

  • {{ data.customer.shipping_address.country[0].name }}
    Returns the customer shipping address country name. For example, United Kingdom.

  • {{ data.customer.shipping_address.state }}
    Returns an array of the customer shipping address state.

  • {{ data.customer.shipping_address.state[0].code }}
    Returns the customer shipping address state in code format. For example, AZ for Arizona.

  • {{ data.customer.shipping_address.state[0].name }}
    Returns the customer shipping address state code name. For example, Arizona.

  • {{ data.customer.shipping_address.company }}
    Returns the customer company name that’s used for shipping details.

  • {{ data.customer.shipping_address.default }}
    Returns the customer shipping address default option. For example, true or false.


Customer group variables

The {{ data.customer.group }} variables are:

  • {{ data.customer.group }}
    Returns an array of the customer groups the customer is attached to.

  • {{ data.customer.group[0].Id }}
    Returns the customer group ID.

  • {{ data.customer.group[0].Name }}
    Returns the customer group name. For example, Wholesale


Order variables

You can find Liquid code that’s available for Order confirmation and other order related transactional email campaigns below, including examples.


Order data variables

The {{ data.order }} variables are:

  • {{ data.order.id }}
    Returns the order ID.

  • {{ data.order.email }}
    Returns the email address of the customer that places the order.

  • {{ data.order.purchase_date }}
    Returns the date and time the customer purchases an order. For example, 2020-07-08T14:33:57Z.

  • {{ data.order.order_subtotal }}
    Returns the order subtotal.

  • {{ data.order.base_subtotal_incl_tax }}
    Returns the order subtotal and includes the tax.

  • {{ data.order.discount_amount }}
    Returns any order discount amounts.

  • {{ data.order.order_total }}
    Returns the order total.

  • {{ data.order.payment }}
    Returns the order payment method. For example, Bank deposit.

  • {{ data.order.delivery_method }}
    Returns the order delivery method. For example, Flat rate.

  • {{ data.order.delivery_total }}
    Returns the order delivery total.

  • {{ data.order.currency }}
    Returns the order currency. For example, GBP.

  • {{ data.order.order_status }}
    Returns the order status. For example, Awaiting payment.

  • {{ data.order.coupon_code }}
    Returns any order coupon codes that were used.

  • {{ data.order.store_name }}
    Returns the store name where the order was placed.

  • {{ data.order.source }}
    Returns the source where the order was placed. For example, eBay and Checkout API.


Order billing address variables

The {{ data.order.billing_address }} variables are:

  • {{ data.order.billing_address.Id }}
    Returns the order billing address ID.

  • {{ data.order.billing_address.type }}
    Returns the order type. For example, Billing.

  • {{ data.order.billing_address.first_name }}
    Returns the first name that’s used for the billing address.

  • {{ data.order.billing_address.last_name }}
    Returns the last name that’s used for the billing address.

  • {{ data.order.billing_address.billing_postcode }}
    Returns the post code that’s used for the billing address.

  • {{ data.order.billing_address.billing_address_1 }}
    Returns the first line of the billing address.

  • {{ data.order.billing_address.billing_address_2 }}
    Returns the second line of the billing address.

  • {{ data.order.billing_address.phone }}
    Return the phone number.

  • {{ data.order.billing_address.billing_city }}
    Returns the billing address city.

  • {{ data.order.billing_address.billing_country }}
    Returns the billing address country.

  • {{ data.order.billing_address.state[0].code }}
    Returns the billing address state code. For example, AZ for Arizona.

  • {{ data.order.billing_address.state[0].name }}
    Returns the billing address state name. For example, Arizona.

  • {{ data.order.billing_address.company }}
    Returns the company name.

  • {{ data.order.billing_address.fax }}
    Returns the fax number.

  • {{ data.order.billing_address.default }}
    Returns the default billing address. For example, true or false.

    • The default order billing address attribute stores addresses that a customer enters where one is the default.

  • {{ data.order.billing_address.email }}
    Returns the billing email address.


Order delivery address variables

The {{ data.order.delivery_address }} variables are:

  • {{ data.order.delivery_address }}
    Returns the delivery address.

  • {{ data.order.delivery_address.Id }}
    Returns the delivery ID.

  • {{ data.order.delivery_address.type }}
    Returns the delivery type. For example, Shipping.

  • {{ data.order.delivery_address.first_name }}
    Returns the first name.

  • {{ data.order.delivery_address.last_name }}
    Returns the last name.

  • {{ data.order.delivery_address.delivery_postcode }}
    Returns the delivery address post code.

  • {{ data.order.delivery_address.delivery_address_1 }}
    Returns the first line of the delivery address.

  • {{ data.order.delivery_address.delivery_address_2 }}
    Returns the second line of the delivery address.

  • {{ data.order.delivery_address.phone }}
    Returns the phone number.

  • {{ data.order.delivery_address.delivery_city }}
    Returns the delivery address city.

  • {{ data.order.delivery_address.delivery_country }}
    Returns the delivery address country. For example, United Kingdom.

  • {{ data.order.delivery_address.state[0].code }}
    Returns the deliver address state code. For example, AZ for Arizona.

  • {{ data.order.delivery_address.state[0].name }}
    Returns the delivery address state name. For example, Arizona.

  • {{ data.order.delivery_address.company }}
    Returns the company name.

  • {{ data.order.delivery_address.fax }}
    Returns the fax number.

  • {{ data.order.delivery_address.default }}
    Returns the default order delivery address. For example, true or false.

    • The default order delivery address attribute stores addresses that a customer enters where one is the default.

  • {{ data.order.delivery_address.email }}
    Returns the email address.


Order product variables

The {{ data.order.products }} variables are:

  • {{ data.order.products }}
    Lists the line item products in the order as an array.

  • {{ data.order.products[x].name }}
    Returns the name of the products.

  • {{ data.order.products[x].price }}
    Returns the product unit price.

  • {{ data.order.products[x].price_inc_tax }}
    Returns the product unit price, including the tax.

  • {{ data.order.products[x].sku }}
    Returns the product SKU.

  • {{ data.order.products[x].qty }}
    Returns the quantity of product.

  • {{ data.order.products[x].options }}
    Contains an array of all the options for this particular product. For example, Colour: blue, size: 8.

  • {{ data.order.products[x].options[x].name }}
    Returns the product options name. For example, Colour.

  • {{ data.order.products[x].options[x].value }}
    Returns the product options value. For example, Blue.

  • {{ data.order.products[x].image_path }}
    Returns either the image or a similar product or the configurable variant image, if available. For example, https://cdn......./image.png.

  • {{ data.order.products[x].url }}
    Returns the product URL. For example, https://store.com/product.html

Order comment variable

  • {{ data.order.comment }}
    Returns customer shipping comment. For example, Please leave this with my neighbours! Thank you.

You can use a combination of the above variables to create your transactional email template. Here’s an example of what you can do:

Hi, {{ data.order.billing_address.first_name }}. 

Thanks for your order {{ data.order.id }}!

Your order status is now: {{ data.order.order_status}}.

You've ordered the following products:
Items {% for product in data.order.products %}
{{product.name}} (
{{product.sku}}) x
{{product.qty}}
{% if product.options %}
{% for option in product.options %}
{{option.name}}:{{option.value}}|
{%endfor%}
{% endif %}
Price:{{product.price_inc_tax}} -----------------------------------
----------------------
{% endfor %}

Order shipment variables are available for these email types:

  • Shipping confirmation

  • Order partially shipped

The {{ data.shipment }} variables are:

  • {{ data.shipment.id }}
    Returns the shipping ID.

  • {{ data.shipment.order_id }}
    Returns the order ID.

  • {{ data.shipment.tracking_numbers }}
    Returns an array of all the tracking numbers available for this shipment.

  • {{ data.shipment.tracking_numbers[0].carrier_id }}
    Returns the ID of the carrier. For example, UPS Ready.

  • {{ data.shipment.tracking_numbers[0].tracking_number }}
    Returns the shipment tracking number.

  • {{ data.shipment.created_at }}
    Returns the date the shipment was created at.

Did this answer your question?