1. Documentation /
  2. Email variables and merge tags

Email variables and merge tags

Note:WooCommerce Follow-ups is a premium extension.

Introduction to variables

↑ Back to top
Each follow-up type is designed for a different function, and used for a specific purpose in your marketing plan. This section provides an outline of all the unique variables that are available for each email and Twitter message type. Remember that some email types will only work only if an additional plugin is installed and activated, so you may not have access to a specific variable or type. If the variable is not listed within an email type, it does not mean it cannot be used. You will note the list of common variables at the bottom – these variables can be used with any email type. Variables for a particular email or tweet are listed in a meta-box (typically) on the right column of the Create/Edit Email page. These are the fields (or merge tags) that can be inserted in various parts of your email that will be replaced with dynamic data based upon who the specific message is being sent to, when, and why. You will notice that some variables are common to all email types, and can handle all of the general information, such as store name, customer email, order number, etc. There are also specialized variables, that are only used when a specific email type is used. For example, a Sensei email would have additional variables for test name, course name, and start date of course. These extra variables will appear on the editing screen only if the corresponding email type is selected for the email you’re creating/editing.

All generic variables

↑ Back to top

Variable code Variable description
{item_names} The explicit name(s) of the purchased items the email was triggered for as a link back to the item
{customer_username} Displays the username of your customer
{customer_first_name} Displays the first name of your customer
{customer_last_name} Displays the last name of your customer
{customer_name} Displays the concatenated first and last name of your customer
{customer_email} Displays your customer’s email address
{order_number} Outputs the order number for the order
{order_date} Outputs the date of the order
{order_datetime} Outputs the date and time of the order
{order_subtotal} Outputs the order total minus the tax and shipping amounts
{order_tax} Outputs the tax amount of the order
{order_pay_method} Outputs the payment gateway or payment method used
{order_pay_url} URL for customer to pay their (unpaid – pending) order
{order_billing_address} Outputs the billing address for the specified order
{order_shipping_address} Outputs the shipping address for the specified order
{coupon_code} Outputs the dynamically generated coupon code for the customer. * must be using the “after coupon used trigger
{coupon_code_used} Outputs the coupon code used by the customer for the order. * must be using the “after coupon used trigger
{coupon_amount} Outputs the value of the coupon generated/used. * must be using the “after coupon used trigger
{dollars_spent_order} Outputs the amount that the customer spent for the order
{store_url} Outputs your store’s URL/web address without https
{store_url_secure} Displays your store’s URL/web address with https
{store_url=path} Displays a URL appended to your domain allowing for tracking of the link. For example, you can use {store_url=/my-account} to send your customer to their account page
{store_name} Displays the name of your store
{unsubscribe_url} Displays a dynamically generated URL that the customer can click to unsubscribe from emails
{post_id=xx} Displays an excerpt of a selected blog post where “xx” = the post ID
{download_url} Displays the URL to the downloadable file when available
{download_filename} Displays the filename of the downloadable file that is available to the customer
{order_billing_phone} Displays the billing phone number of the customer
{order_shipping_phone} Displays the shipping phone number for the customer
{webversion_url} Displays the raw URL to visit a webversion of the email – requires being wrapped in a custom link in the email body
{webversion_link} Generates a direct link to the webversion of the email with the text “View in browser”

Abandoned cart emails

↑ Back to top
Variable code Variable description
{cart_contents} Renders the contents of the known user’s cart
{cart_total} Displays the total order value in the cart
{cart_url} This complex variable will automatically redirect the user to their cart if they are logged in. If they are not logged in, they will be sent to “My-Account” where they will be redirected to their cart after logging in.

All product storewide

↑ Back to top
Variable code Variable description
{item_names} The name(s) of the purchased item(s) as a link back to the item
{item_names_list} Displays a comma-separated list of products purchased
{item_prices} Displays a list of purchased items, quantities, and prices
{item_codes_prices} Displays a list of purchased items with the quantities, SKUs (codes), and prices
{item_prices_categories} Displays a list of purchased items with their quantities, categories, and prices
{item_categories} The list of categories that the purchased items are contained in
{dollars_spent_order} Displays the total amount paid on the order by the customer

A specific product storewide

↑ Back to top
Variable code Variable description
{item_names} The name(s) of the purchased item(s) as a link back to the item
{item_names_list} Displays a comma-separated list of products purchased
{item_prices} Displays a list of purchased items, quantities, and prices
{item_prices_image} Displays a list of purchased items, quantities, and prices with images
{item_codes_prices} Displays a list of purchased items with the quantities, SKUs (codes), and prices
{item_prices_categories} Displays a list of purchased items with their quantities, categories, and prices
{item_categories} The list of categories that the purchased items are contained in
{dollars_spent_order} Displays the total amount paid on the order by the customer
{item_names} The explicit name(s) of the purchased item the email was triggered for as a link back to the item
{item_code} Displays the code (SKU) of the explicit product the email was triggered for
{item_url} Displays the URL of the purchased item
{item_category} Displays the category of the explicit product the email was triggered for
{refund_amount} Outputs the value of the amount refunded
{refund_reason} Outputs the reason for the refund
{item_price} Displays the price of the explicit product the email was triggered for
{item_quantity} Displays the number of the products purchased
{cf ID field_name} These variables are dynamic and only on specific products. You can use custom fields to display data about a product by enabling “Use Custom Field”, choosing the field and copying the variable that is displayed to you. For example {cf 34 _thumbnail_id}

A specific category storewide

↑ Back to top
Variable code Variable description
{item_name} The name(s) of the purchased item(s) as a link back to the item
{item_names_list} Displays a comma-separated list of products purchased
{item_prices} Displays a list of purchased items, quantities, and prices
{item_prices_image} Displays a list of purchased items, quantities, and prices with images
{item_codes_prices} Displays a list of purchased items with the quantities, SKUs (codes), and prices
{item_prices_categories} Displays a list of purchased items with their quantities, categories, and prices
{item_categories} The list of categories that the purchased items are contained in
{dollars_spent_order} Displays the total amount paid on the order by the customer

Sign-up emails

↑ Back to top
Variable code Variable description
See generic variables Sign-up emails support all generic variables

Manual emails

↑ Back to top
Variable code Variable description
See generic variables Manual emails support all generic variables the customer is in the database (customer or user). Some variables may not work for manually entered email addresses or subscriber lists.

Sensei emails

↑ Back to top
Variable code Variable description
{course_name} Displays the name of the course
{course_url} Outputs the raw URL to the course
{course_link} Displays a link to the selected course
{lesson_name} Displays the name of the lesson
{lesson_url} Outputs the raw URL to the lesson
{lesson_link} Displays a link to the selected lesson
{quiz_grade} Displays the score the user received for the quiz selected
{quiz_passmark} Displays the passing mark the user received for the quiz
{quiz_url} Outputs the raw URL to the quiz
{quiz_link} Displays a link to the selected quiz
{certificate_url} Outputs the raw URL to the certificate – certificates must be enabled in Sensei
{certificate_link} Displays a link to the selected certificate – certificates must be enabled in Sensei

Customer emails

↑ Back to top
Variable code Variable description
{amount_spent_order} Displays the amount spent on their order
{amount_spent_total} Displays the total amount spent by that customer in your store
{number_orders} Displays the count of orders made by your customers
{last_purchase_date} Displays the date that the customer last submitted an order

Subscription emails

↑ Back to top
Variable code Variable description
{item_names} The name(s) of the purchased items (including subscriptions) as a list of links
{item_names_list} Displays a comma-separated list of purchased items (including subscriptions)
{item_quantity} Displays the quantity purchased is a specific subscription is selected
{subs_start_date} Displays the date that the user’s subscription starts
{subs_renew_date} Displays the date that the user’s subscription will renew
{subs_end_date} Displays the date that the user’s subscription ends
{days_to_renew} Outputs the number of days until the subscription renews
{subs_trial_length} Displays the length of time that the user’s subscription trial will go for
{subs_first_payment} Outputs the total amount paid for the first payment which could include subscription fees and sign-up fees
{subs_cost_term} Outputs the cost and the term/renewal in the form of $100 / month for 3 months
{subs_cost} Outputs the cost of the subscription in the form of $100 / month
{subs_id} Outputs the subscription ID which might differ from the order ID
{item_categories} The list of categories that the subscription(s) are contained in

Bookings emails

↑ Back to top
Variable code Variable description
{item_names} The name(s) of the purchased item
{item_category} Outputs the list of categories for the purchased item
{booking_start} Outputs the start date of the booked product or service
{booking_end} Outputs the end date of the booked product or service
{booking_duration} Outputs the duration of the booked product or service
{booking_date} Outputs the date of the booked product or service
{booking_time} Outputs the time of the booked product or service
{booking_amount} Outputs the amount or cost of the booked product or service
{booking_resource} Outputs the name of the resource booked
{booking_persons} Outputs the count of persons this booking is for

Points and Rewards emails

↑ Back to top
Variable code Variable description
{points_earned} Outputs the total number of points earned for the customer
{reward_event_description} Outputs a description of the action that earned the customer the points

The Events Calendar & WooTickets

↑ Back to top
Variable code Variable description
{event_name} Outputs the name of the event
{event_link} Outputs the name of the event with a link to the event page
{event_url} Outputs the URL of the event
{event_location} Outputs the name and address of the event venue
{event_organizer} Outputs the name of the event organizer
{event_start_datetime} Outputs the start date/time of the event
{event_end_datetime} Outputs the end date/time of the event
{ticket_name} Outputs the name of the ticket
{ticket_description} Outputs the description of the ticket

Twitter

↑ Back to top
Variable code Variable description
{twitter_handle} Outputs the Twitter handle of the customer (includes the “@”)
{order_items} Outputs a comma-separated list of the items ordered

Custom variables

↑ Back to top
Need a variable beyond what is shown here? You can create your own custom variables using the “fue_before_variable_replacement” hook as documented here.