Email Template Variables


Subscribe Pro email templates contain variables that are used to display particular values unique to your store and the Subscription Orders that your customers have placed. Its important to understand these variables so you can fully customize your templates.

Subscribe Pro uses the Twig PHP template engine to power email templates, so you can reference their documentation to learn the syntax and find useful filters, functions, and more.

Email templates should be surrounded by two curly brackets (e.g. {{ variable }}). For variables containing dates/times, you can affix the variable with the |date('format') filter to choose the format for your date, following the PHP date formatting rules. For example: {{ variable|date('M d, Y') }}

Top-level Email Template Variables

Variable NameVariable Description
customerIdThe Subscribe Pro customer ID for the subscription.
platformSpecificCustomerIdCustomer ID from external e-commerce platform linked customer record.
customerServiceEmailThe email for your support as defined in the Subscribe Pro Environment settings.
customerServicePhoneThe phone number for your support in the Subscribe Pro Environment settings.
magentoFrontendUrl The url to the customer facing side of your Magento store
magentoAdminUrl The url to the administration panel of your Magento store
storeLogoUrlThe url to the logo you upload in your Subscribe Pro Environment configuration.
storeNameThe name of your Magento store as defined in the Subscribe Pro Environment settings.
templateImagesUrl The root directory that holds your template related images (typically '/images' by default)
fullName
name
The customer's full name as filled out in their customer profile. Note: Either fullName or name may be used, as they contain the same information.
firstNameThe customer's first name, as filled out in their customer profile.
middleNameThe customer's middle name as filled out in their customer profile.
lastNameThe customer's last name as filled out in their customer profile.
emailThe customer's email address as filled out in their customer profile.
customerSubscriptionCountCount of all subscriptions for this customer.
customerActiveSubscriptionsCountCount of all active subscriptions for this customer.
customerActiveSubscribedQuantityTotal quantity for all active subscribed product SKUs for this customer.
subscriptionStatusThe current status of the subscription at the time of the email.
subscriptionCreatedDateTimeThe date and time the subscription was created.
subscriptionNextOrderDateThe next shipping date for the product ordered in the subscription.
subscriptionCardNumber
subscriptionCardLastDigits
The last four digits of the credit card.
subscriptionCardTypeThe card type (e.g. Visa, Master Card, etc.)
subscriptionIntervalThe time in between subscription shipments for this particular order as defined by the customer for the first subscription in the order.

Note: individual products in the order may have their own intervals, stored in item.productInterval. This variable is meant to be used outside of the product loop.
subscriptionScheduleNameCustomer-friendly name of frequency interval or parameterized advanced scheduling rule. For example: Every 30 Days, Every 3rd Tuesday, etc
subscriptionCouponCode If there is a valid coupon code applied to the whole Subscription, it will be displayed with this variable code
subscriptionMagentoShippingAddressIdThe Magento Address ID for the shipping address.
subscriptionMagentoBillingAddressIdThe Magento Address ID for the billing address.
shippingAddressFirstNameThe first name used in the shipping address
shippingAddressLastNameThe last name used in the shipping address
shippingAddressCompanyThe company used in the shipping address
shippingAddressStreet1The street address used for shipping
shippingAddressStreet2The optional second line of the street address used for shipping
shippingAddressCityThe city used for shipping
shippingAddressRegionThe region (state) used for shipping
shippingAddressPostcodeThe zip/postal code used for shipping
shippingAddressCountryThe country used for shipping

Item-Specific Email Template Variables

The following variables can only be used inside the item loop. These variables will be different per subscription included in the order, whereas the above variables represent the entire order.

Here is an example from our default subscription_created template:

{% for item in subscriptionProducts%}
<li style="margin-bottom:10px;">
  <strong>Product Name: {{ item.productName }}</strong><br />
  SKU: {{ item.productSku }}<br />
  Quantity: {{ item.qty }}<br />
  Prices: ${{ item.price }}<br />
  Discount: {{ item.discountText }}<br />
</li>
{% endfor %}

In the above, the item in item.productName is defined in the for loop. If you use a different variable name in place of item, the variable name in all of the following variables will need to be changed accordingly.

Variable NameVariable Description
item.subscriptionIdThe subscription ID associated with the subscription product.
item.productSkuThe unique product number identifier of the item in the subscription order
item.productNameThe product name of the item in the subscription order
item.productIntervalThe interval used for this individual product.
item.productNextOrderDateThe next order date of the subscription.
item.productLastOrderDateThe date of the most recent order of the subscription.
item.productExpirationDateThe expiration date of the subscription.
item.scheduleNameCustomer-friendly name of frequency interval or parameterized advanced scheduling rule. For example: Every 30 Days, Every 3rd Tuesday, etc
item.qty The number / quantity of items in the subscription order
item.priceThe price of 1 item in the subscription order
item.discount * 100The discount applied (* 100) to the product item in the subscription order, in percent (%). This is separate and before the subscription wide coupon code is applied
item.discountTextThe discount text as shown on the product page
item.is_discount_percentage
item.isDiscountPercentage
A boolean variable for determining whether or not the discount for this product is a percentage or a fixed value.
item.thumbnailUrlThe URL of the product thumbnail to be displayed with that item's details in the template.
item.msrpThe MSRP field from Manage > Subscription Products > (edit) > Product Feed Data.
item.salePriceThe Sale price field from Manage > Subscription Products > (edit) > Product Feed Data.
item.isOnSaleWhether or not the (from Manage > Subscription Products > (edit) > Product Feed Data). This can be used to determine whether the item.SalePrice or item.price field should be used.

For instance:
{% if item.isOnSale %}{{ item.salePrice }}{% else %}{{ item.price }}{% endif %}
item.fixedPriceThe fixed price set on a subscription, if any.
item.useFixedPriceWhether or not this subscription uses a fixed price.
item.errorClassThe error class for a failed subscription. Example: soft_decline, magento, hard_decline, payment_card, technology.

Note: An explanation for each class of error is available in our documentation about Automatic Ordering.
item.errorClassTextThe text explaining what an error class means. Note that this is not the actual error message, which is available in item.errorMessage.
item.errorMessageThe actual error message explaining why a subscription failed.
item.userDefinedFieldsUser-defined fields and values for subscription item.
item.recurringOrderCountRecurring order count for this subscription. The number of recurring orders which have already been processed. If an order was processed when the subscription was created, this initial order is NOT counted.