When you’re
setting up your first Campaign Monitor transactional email for WooCommerce, you will notice quickly that you will need some dynamic content to fill your emails. For example, for a password reset email you need a password reset link, for a account register email a username and password can’t be missing, order emails need the order data etc.
With the WooCommerce Campaign Monitor various variables are passed along to Campaign Monitor that you can use in your email. Variables can be used by entering them in the mail content (or subjects) via the
Campaign Monitor template language. A normal variable can be displayed when using the following code:
{{ variable_name }}
Below I will display the variables for each email that can be used. If you want to use the variables in a email you need to have it mapped in the Campaign Monitor settings page found under
WooCommerce -> Settings -> Campaign Monitor.
New account transactional email
The following variables are available for the ‘new account’ email.
{{ id }} - Customer ID {{ first_name }} - Customer's first name (if known) {{ last_name }} - Customer's last name (if known) {{ email }} - Customer's email address {{ username }} - Customer's username {{ password }} - Customer's password {{ display_name }} - Customer's display name {{ my_account_link }} - Link to the My account page
Password reset transactional email
The following variables are available for the ‘password reset’ email.
{{ id }} - Customer ID {{ first_name }} - Customer's first name (if known) {{ last_name }} - Customer's last name (if known) {{ email }} - Customer's email address<br>{{ display_name }} - Customer's display name {{ password_reset_link }} - Click to reset password link
Processing order transactional email
The following variables are available for the ‘processing order’ email.
{{ id }} - Customer ID {{ first_name }} - Customer's first name (if known) {{ last_name }} - Customer's last name (if known) {{ billing_address }} - Fully formatted billing address {{ shipping_address }} - Fully formatted shipping address {{ my_account_link }} - Link to the my-account page {{ customer_note }} - Customer note {{ phone }} - Customer phone number {{ email }} - Customer email {{ order_date }} - Order date {{ order_number }} - Order number {{ order_total }} - Order total {{ order_formatted_total }} - Order total fully formatted with currency {{ order_tax }} - Order tax amount {{ order_subtotal }} - Order subtotal {{ order_subtotal_to_display }} - Order subtotal formatted with currency {{ order_total_discount }} - Total order discount {{ order_discount_to_display }} - Total order discount formatted with currency {{ order_currency }} - Order currency {{ shipping_methods }} - A comma separated string with the shipping rates {{ shipping_method_list }} - A list of shipping methods (array) {{ shipping_to_display }} - Shipping rates as seen on default WC emails {{ payment_gateway }} - Payment gateway used {{ order_status }} - Current order status {{ downloads_table }} - The table as shown in WC Core emails {{ order_downloads }} - A list of downloads items - List of order items {% for item in items %} {{ item.name }} - Product name {{ item.produdct_link }} - Link to your product page {{ item.quantity }} - Quantity of this product ordered<br> <br> {{ item.line_total }} - Product total {{ item.line_tax }} - Product total taxes {{ item.line_subtotal_tax }} - Product subtotal taxes {{ item.purchase_note }} - Product note (if set) {{ item.product_id }} - Product ID {{ item.variation_id }} - Variation ID (if set) {{ item.tax_class }} - Tax class for this product {{ item.display_line_subtotal }} - Amount formatted to WC format (including currency and decimals) {{ item.display_line_total }} - Amount formatted to WC format (including currency and decimals) {{ item.display_line_subtotal_tax }} - Amount formatted to WC format (including currency and decimals) {{ item.display_line_tax }} - Amount formatted to WC format (including currency and decimals) {% endfor %}
Completed order transactional email
The variables for the order complete email are identical to the ‘processing order’ email.
Customer invoice transactional email
The variables for the customer invoice email are identical to the ‘processing order’ email.
Customer noteĀ email
The variables for the customer note email are identical to the ‘processing order’ email.
Cancelled order transactional email
The variables for the cancelled order email are identical to the ‘processing order’ email.
Customer invoice transactional email
The variables for the customer invoice email are identical to the ‘processing order’ email.
Order refund transactional email
The variables for the order refund email are also identical to the ‘processing order’ email, but also has a couple extra variable to complement the email.
{{ refund_partial }} - 'yes' or 'no' value determining if its a full or partial refund {{ refund_date }} - Date the refund was processed {{ refund_number }} - Refund order number {{ refund_total }} - Refund order total amount {{ refund_tax }} - Refund order tax {{ refund_subtotal }} - Refund order subtotal {{ refund_currency }} - Refund order currency {{ refund_amount }} - Refunded amount {{ refund_formatted_amount }} - Formatted refunded amount<br>
New order transactional email
The variables for the new order email are identical to the ‘processing order’ email.