Aurora Email Variables

This article covers the use of variables, functions, includes and place-holders within most Aurora email templates.Using this you should be able to gain a better understanding of how to access and display data from Aurora in your emails, though it should be noted that not all of the fields detailed here are available to all emails.

Introduction

This section aims to introduce you to the different email template systems that are available in Aurora and how they can be used.

There are two basic types of email template:

  • The 'Orders' -> 'Emails' templates (AKA: 'Order Emails'), which are managed via the back-end for use with orders and other common account functions.
  • The 'Email Templates Files', which are managed by FTP and can typically be found and edited in the 'templates' directory of your FTP account, within the 'emails' directory.

Email Special Fields (Placeholders or Variables)

Both of these email template systems use an identical set of values to populate special text elements referred to as placeholders. These placeholders are used to allow commonly required values to be placed into an email at any point. An example of such a placeholder is '{$username}', which would be replaced with the full User Name of the recipient of the email when it is being sent. For example:

Dear {$firstname},

Your order will be with you shortly.

Kind Regards.

Would be received by the customer as...

Dear Tom,

Your order will be with you shortly.

King Regards.

Placeholder Types

There are two 'types' of placeholder, String and Array.

The two types are treated in very different ways. A string placeholder is simply replaced with some value, whether that be a name, price or some other value. It simply marks the place a value will appear.

An array placeholder is different in that it does not get replaced with a single value, but instead is a container for many other values. A typical example of this is the '$basket' placeholder, which holds a set of placeholders for each line of an order's basket. These placeholders can be cycled through using the construct shown below...

{foreach from=$basket item="basket\_line"}  
Product ID is {$basket\_line.product\_id}  
{/foreach}

Note the use of the '.' to mark the end of the placeholder container and the beginning of the one you are requesting.

Globally Available Placeholders

Below is a list of available placeholders that can be used in the email templates.

PlaceholderTypeCurrencyValue
$usernameStringThe customer's registered user name
$email_addressStringThe customer's registered e-mail address
$passwordStringThe customer's registered password
$titleStringThe customer's registered title (e.g. Mr/Mrs/Ms/etc)
$firstnameStringThe customer's registered first name
$lastnameStringThe customer's registered last name
$tracking_urlStringA link to the courier's website with the tracking number for the related customer order, if relevant
$tracking_numberStringThe tracking number for the related customer order, if relevant
$resetpasswordStringA link to the 'Reset Password' feature this the customer
$order_idIntegerThe order ID for the related order, if relevant
$returns_referenceStringThe returns reference number for the related customer order, if relevant
$refund_amountStringDefaultThe refund amount due/paid for the related customer order, if relevant
$orderArrayAll values stored against the related customer order
$order.idIntegerThe Internal ID Aurora uses to identify an Order (if relevant).
$order.date_createdInteger (Timestamp)The time the order was first created/placed.
$order.date_shippedInteger (Timestamp)The time the order was marked as shipped in Aurora.

This value is not always set for all orders, depending on your store's individual configuration and the source of the Order (e.g. third party orders may behave differently).
$order.store_idIntegerThe Internal ID Aurora uses to identify a Store Location.
$order.user_idIntegerThe Internal ID Aurora uses to identify a User/Customer account.
$order.payment_typeStringThe type of payment taken, i.e. Card, eBay, Amazon, etc...
$order.tracking_numberInteger
$order.exchange_rateIntegerThis is the exchange rate set in Aurora at the time the purchase was made.

This is not the exchange rate that was actually charged to the customer in the event exchange was necessary during payment processing. This is only the exchange rate used to convert the prices for display on the Front-end.
$order.order_totalIntegerDefaultThe total value of the order, not including shipping.
$order.shipping_costIntegerDefaultThe shipping cost excluding tax.
$order.shipping_taxIntegerDefaultThe tax attributed to the shipping cost.

To display how much was charged in total for shipping, simply add the "shipping_cost" and "shipping_tax" values together.
$order.order_taxIntegerDefaultThe tax attributed to the ordered items.
$order.coupon_discountIntegerDefaultThe amount of discount issued due to Coupons.
$order.order_discountIntegerDefaultThe amount of discount issued due to certain promotional discounts.
$order.total_discountIntegerDefaultThe total discount applicable to the order.
$order.loyalty_points_earnedIntegerThe number of Loyalty Points earnt as a result of this Order.
$order.additional_fieldsArrayAll order additional fields. Key = field name, Value = field value
$order.itemsArrayContainer for ordered items data.
$order.items.additional_fieldsArrayAll ordered items additional fields. Key = Ordered Item id, Value = Array, where Key = field name, Value = field value
$language_isoString
$delivery_estimateStringThe estimated delivery date for the related customer order
$delivery_methodStringThe delivery method used for the related customer order
$total_costStringThe total cost in the currency of the related customer order
$card_costStringThe amount charged to cards in the currency of the related customer order
$card_numberStringThe last 4 digits of the payment card (if available).

Not all payment methods may have this set where they may not available.
$card_cost_in_poundsStringThe amount charged to cards in GBP for the related customer order
$payment_transactionsArray [ $transaction ]An array of all successful payment transactions for the current order, as described by the '$transaction' array.

Please refer to the Order Transaction Variables article for further details regarding the variables available in the $transaction Container.
$refund_transactionsArray [ $transaction ]An array of all successful payment transactions for the current order, as described by the '$transaction' array.

Please refer to the Order Transaction Variables article for further details regarding the variables available in the $transaction Container.
$invoice_addressArrayAll address details provided for invoicing for the related customer order
$delivery_addressArrayAll address details provided for delivery for the related customer order (when the customer opts to receive their order to a specified address)
$store_infoArrayAll store details available for the related customer order, if relevant (when the customer opts to have their order delivered to a store location)
$collect_plusStringConfirm if it was a Collect+ order
$order_transactionArrayAll details pertaining to the payment transaction made for the related customer order
$order_notesArrayAll details pertaining to the last (most recent) order note for the related customer order
$configArrayAll values from the back-end configuration, allowing customisation or emails according to settings configured in the 'Store' -> 'Settings' section
$currency_idStringThe ID of the currency used for the related customer order
$currencyArrayAll details pertaining to the currency used for the related customer order
$currency_conversionStringThe exchange rate used to convert the monetary values from GBP to the currency used for the related customer order
$cross_sellsArrayAll 'Cross Sell' products for the related customer order
$shipping_costStringThe shipping cost in the currency of the related customer order
$shipping_taxStringThe tax on the shipping
$order_taxStringThe tax on the purchased items. Combined $shipping_tax+$order_tax for the total tax
$default_tax_rateStringThe default tax rate for the site, e.g. "20" if your tax rate is 20%
$payment_costStringThe payment actually taken from the customer in the currency of the related customer order
$discountStringThe total discount applied in the currency of the related customer order
$coupon_discountStringThe discounts applied as a result of coupons alone in the currency of the related customer order
$applied_loyalty_pointsStringThe number of loyalty points used on the related customer order
$basket_loyalty_pointsStringThe number of loyalty points earned on the related customer order
$basket_loyalty_pointsStringThe total number of loyalty points the customer currently has
$contact_infoArrayInformation sent through in a contact form
$failed_itemsArrayThe basket of a failed order
$returned_itemsArrayThe list of returned items, if this is an email regarding a return.
$http_hostStringTo be used to reference the master domain. This should be used instead of $smarty.server.HTTP_HOST as it will continue to work from the CLI.
$refunded_itemsArrayThe list of refunded items, if this is an email regarding a refund.
$refunded_items.x.product_priceFloatPrice the product was refunded at.
$refunded_items.x.product_quantityIntegerQuantity of products refunded.
$refunded_items.x.productArrayFull details of the refunded product.
$userArrayA Container holding all of the User Data.
$user.firstnameStringThe customer's registered first name
$user.lastnameStringThe customer's registered last name
$user.companyStringThe customer's registered company name
$user.email_addressStringThe customer's registered email address
$uri_to_confirm_emailStringThe relative URL to allow a user to verify their email address.

This variable is only present when a user record can be located for the email.
$user_email_verifiedBooleanTRUE if the user's current email address has been verified, otherwise FALSE.
$basketArrayAll dispatched lines (or lines that have no status at all) of the basket for the related customer order
$basket.x.productArrayPlease refer to the Product Details section.
$all_ordered_itemsArrayAll lines of the basket (regardless of status) for the related customer order
$all_ordered_items.x.productArrayPlease refer to the Product Details section.

Updating Order Part Dispatch Status Placeholders

PlaceholderTypeCurrencyValue
$part_order_despatch_usedBooleanTRUE if part despatch is used for this order.
$part_order_despatchhtml textMost Recently shipped part dispatch items rendered using the template "emails/basket.tpl.html" into this variable. Available as $basket variable within this template render.
$not_despatchedhtml textAll ordered items from part despatches that have not yet been shipped rendered using the template "emails/basket.tpl.html" into this variable. Available as $basket variable within this template render.

Updating Order Item Status Placeholders

PlaceholderTypeCurrencyValue
$updated_itemsArrayAll updated items within an order
$updated_items.x.itemArrayItem details and includes product information
$updated_items.x.item.product_priceStringPrice of item that has been updated, this is the individual price.
$updated_items.x.item.product_quantityStringQuantity of item that has been updated
$updated_items.x.item.product_discountStringTotal discount of all related items.
$updated_items.x.item.productArrayPlease refer to the Product Details section.

Email Verification and Notification Specific Placeholders

PlaceholderTypeCurrencyValue
$new_email_adderssStringThe email address the user account is now using or requesting to be used.

Review Specific Placeholders

This system used to make use of the "emails/satisfaction-items.tpl.html" template, but this behaviour has now been deprecated.

This old method and the new one described below cannot be used alongside one-another and if the template described above is found, then Aurora will prevent you from using the new method. This being so, please be sure to check you do not have this file in your Front-end Templates before proceeding and remove it if you do.

PlaceholderTypeCurrencyValue
$reviewed_ordered_itemsArrayThe basket of a completed order, when you are requesting feedback for a review.

Including other templates

Other templates can be included within the Email. This allows you to share content between emails or include large amounts of HTML or text.

Templates are included with the include function e.g.

{include file="includes_folder/my_email_include.tpl.html"}

The template include path is from your front end templates directory for that site e.g. templates/example.com/. In the example above the includes_folder would be located at templates/example.com/includes_folder

Example Review Request Email Template

👍

For more general information regarding how to manage Review Reminder Emails and where to use the below template content, please see the Review Reminder Emails Support Article

The content in this email should be something like the following, in order to display your particular message and product links.

<p style="margin: 15px 0;">Hi there, we are just getting in touch to see if you liked your experience!</p>
 
<p style="margin: 15px 0;">
{foreach from=$reviewed_ordered_items item=order_item}
Review your product: <a href="http://{$http_host}/products/reviews/write/{$order_item.product_id}">{$order_item.product_name}</a><br />
{/foreach}
</p>