The following table describes the syntax in which Magento transactional email variables should be coded in the emails sent by Emarsys. It is based on the Magento documentation.

These variables can be used in any combination in their respective event emails and are listed here as Magento lists them. To use the variables simply type in the placeholder syntax as shown below (for example: %%product_name%%) into the header, body text or subject line of the email. We recommended that you select the variables you want and test them until you find the combination that best suits your needs.

Global Placeholders

These can be used in any of the sections in any transactional email.

Magento content Emarsys placeholder
{{var logo_url}} %%logo_url%%
{{skin url=””}} %%skin_url%%
{{store url=””}} %%store_url%%
{{store url="customer/account/resetpassword/" _query_id=$customer.id_query_token=$customer.rp_token}} %%reset_password_link%%
{{var password}} %%password%%
{{var subscriber.getConfirmationLink()}} %%confirmation_link%%
{{var subscriber.getUnsubscriptionLink()}} %%unsubscription_link%%
{{var subscriber.email}} %%subscriber_email%%
{{var addAllLink}} %%add_all_link%%
{{var alertGrid}} %%alert_grid%%
{{var user.name}} %%user_name%%
{{var viewOnSiteLink}} %%view_on_site_link%%
{{var warnings}} %%warnings%%

Order Placeholders

The following placeholders are available for the Order Confirmation transactional email.

Magento order content Emarsys placeholder
{{var order.id}} %%order_id%%
{{var order.increment_id}} %%order_increment_id%%
{{order.getShippingAddress().format(‘html’)}} %%order_shipping_address%%
{{var shippingAddress.format(‘html’)}} %%shipping_address_format%%
{{var shippingMethod}} %%shipping_method%%
{{var order.getShippingAddress().getName()}} %%order_shipping_name%%
{{var order.getShippingAddress().getFirstName()}} %%order_shipping_firstname%%
{{var order.getShippingAddress().getMiddleName()}} %%order_shipping_middlename%%
{{var order.getShippingAddress().getLastName()}} %%order_shipping_lastname%%
{{var order.getShippingAddress().getStreet1()}} %%order_shipping_street1%%
{{var order.getShippingAddress().getStreet2()}} %%order_shipping_street2%%
{{var order.getShippingAddress().getCity()}} %%order_shipping_city%%
{{var order.getShippingAddress().getRegion()}} %%order_shipping_region%%
{{var order.getShippingAddress().getPostcode()}} %%order_shipping_postcode%%
{{var order.getShippingAddress().getCountry()}} %%order_shipping_country%%
{{var order.getShippingAddress().getName()}} %%order_shipping_country_name%%
{{var order.getShippingAddress().getTelephone()}} %%order_shipping_phone%%
{{var order.getShippingAddress().getPrefix()}} %%order_shipping_prefix%%
{{var order.getShippingAddress().getSuffix()}} %%order_shipping_suffix%%
{{var order.customer email}} %%order_customer_email%%
{{var billingAddress.format(‘html’)}} %%billing_address_format%%
{{var order.getBillingAddress().format(‘html’)}} %%order_billing_address_format%%
{{var order.getBillingAddress().getName()}} %%order_billing_address_name%%
{{var order.getCreatedAtFormated(‘long’)}} %%order_created_at_format%%
{{var order.getCustomerName()}} %%order_customer_name%%
{{var order.getCustomerFirstname()}} %%order_customer_firstname%%
{{var order.getCustomerLastname()}} %%order_customer_lastname%%
{{var order.getShippingDescription()}} %%order_shipping_description%%
{{var order.getStatusLabel()}} %%order_status_label%%
{{var order.getStoreGroupName()}} %%order_store_group_name%%
{{var order.getEmailCustomerNote()}} %%order_email_customer_note%%
{{var payment html}} %%payment_html%%
{{var paymentMethod}} %%payment_method%%
{{var reason}} %%reason%%
{{var billing.name}} %%billing_name%%
{{var checkoutType}} %%checkout_type%%
{{var total}} %%total%%
{{var order.getData(‘subtotal’)}} %%subtotal%%
{{var order.getGrandTotal()}} %%grand_total%%
{{var shipment.increment_id}} %%shipment_increment_id%%
{{var order.getShippingAmount()}} %%shipping_costs%%
{{var order.getData(‘base_shipping_amount’)}} %%base_shipping_amount%%
{{var order.getData(‘coupon_code’)}} %%coupon_code%%
{{var order.getFullTaxInfo()}} %%order_tax_info%%
{{var order.getShippingTaxAmount()}} %%order_shipping_tax_amount%%
{{var store.getCurrentCurrencyCode()}} %%currency_code%%
Currency symbol %%currency_symbol%%
{{var comment}} %%comment%%
{{var creditmemo.id}} %%creditmemo_id%%
{{var creditmemo.increment_id}} %%creditmemo_increment_id%%

Order item placeholders

Transactional emails related to purchases (in Magento: Order Confirmation emails) are a special case since you may want to display a number of different products all formatted the same way. For this, you can define a section in the Emarsys email campaign that will be duplicated as many times as the number of products purchased.

To do this, define the Emarsys External identifier of the section as product_purchases. This identifier is case-sensitive so must be written exactly in this way and should not appear in more than one section.

magento_txm_9

New sections with this identifier will be automatically created according to the number of items in the order (for example three items in the order will result in three sections being created).

In order to format the product lines correctly, the following product-related placeholders are available:

Magento product content Emarsys placeholder
Magento Product ID %%product_id%%
Magento Product Type (Simple, Grouped, Configurable, Virtual, Bundle, Downloadable) %%product_type%%
Magento Base Original Price %%base_original_price%%
Stock Keeping Unit %%sku%%
Product Name %%product_name%%
Product Description %%product_description%%
Product Short Description %%short_description%%
Product Weight %%product_weight%%
Quantity Ordered %%qty_ordered%%
Full options (example: Color : Black – Size : M) %%full_options%%
Product Original Price %%original_price%%
Product Additional Data, if available %%additional_data%%
Product Price %%price%%
Product Base Price %%base_price%%
Tax Percent %%tax_percent%%
Tax Amount %%tax_amount%%
{{var order.getData(‘discount_amount’)}} %%discount_amount%%
Product tax amount %%unitary_tax_amount%%
Total tax amount for the product line %%line_total_tax_amount%%
Unitary price (excl. taxes) %%unitary_price_exc_tax%%
Unitary price (incl. taxes) %%unitary_price_inc_tax%%
Price line total (excl. taxes) %%line_total_price_exc_tax%%
Price line total (incl. taxes) %%line_total_price_inc_tax%%

There is an additional set of placeholders related to the attributes that depends on the product nature. They are built with the prefix attribute_ and are followed by the name of the product attribute, for example:

  • attribute_sku
  • attribute_gender
  • attribute_sleeve_length

Note: This type of section builds a product HTML content when the following four placeholders are provided at the triggering of the event. The extension takes charge of it adding the corresponding data automatically, so they will appear automatically in the product section.

Magento product content Emarsys placeholder Description
Product name _url_name Section link name.
Link to the product in the store _url Section link url.
Link to the product thumbnail _external_image_url Section image.
Link to a product small image _external_mobile_image_url Section mobile image.

Registration Placeholders

These placeholders can be used when registering a new customer, in the Confirmation Link email and Welcome email.

Magento customer content Emarsys placeholder
{{var customer.ID}} %%customer_id%%
{{var customer.email}} %%customer_email%%
{{var customer.firstname}} %%firstname%%
{{var customer.lastname}} %%lastname%%
{{var customer.name}} %%customer_name%%
{{var customer.created in}} %%customer_created_in%%
{{var customer.dob}} %%date_of_birth%%
{{var customer.password hash}} %%password_hash%%
{{var customer.password}} %%password%%
{{var customer.prefix}} %%customer_prefix%%
{{var customer.middlename}} %%middlename%%
{{var customer.suffix}} %%customer_suffix%%
{{var customer.group id}} %%customer_group_id%%
{{var customer.taxvat}} %%customer_taxvat%%
{{var customer.store.name}} %%customer_store_name%%
{{var customer.store.group.name}} %%customer_store_group_name%%
[[:Template:Store url="customer/account/resetpassword/" query id=$customer.id query token=$customer.rp token}} %%reset_password_link%%
[[:Template:Store url="customer/account/confirm/" query id=$customer.id query key=$customer.confirmation query back url=$back url}} %%email_confirm_link%%
{{var data.comment}} %%data_comment%%
{{var data.email}} %%data_email%%
{{var data.name}} %%data_name%%
{{var data.telephone}} %%data_ telephone%%
{{var dateAndTime}} %%date_and_time%%
{{var invoice.id}} %%invoice_id%%
{{var invoice.increment_id}} %%invoice_increment_id%%
{{var invoice.created_at}} %%invoice_created_at%%
{{var items}} %%items%%
{{var items_html}} %%items_html%%

‘Send to a friend’ Placeholders

These placeholders can be set for the Magento transactional mail Send to a friend.

Magento product content Emarsys placeholder
{{var product_image}} %%product_image%%
{{var name}} %%name%%
{{var email}} %%friend_email%%
{{var product_name}} %%product_name%%
{{var product_url}} %%product_url%%
{{var message}} %%message%%
{{var sender_name}} %%sender_name%%
{{var sender_email}} %%sender_email%%