What tags do you support in email templates?
Supported Tags or Variables
Recapture supports tags (also known as template variables or dynamic data) within our emails. They can be used in various places, including:
- Subject line
- Preview text
- Email body text
When you use a tag/variable, you are expecting Recapture to replace that with something that is specific to the person who is receiving the email--for example, their first name, the list of products they ordered, or how much they spent.
Template Conventions
To use the variable placeholders, you'll want to use these template conventions:
{{ object.field_name }}
There's a space on each side of the curly braces for readability-- but they are optional, so this is valid too:
{{object.field_name}}
Variables we support (per email type)
Each type of email has different data available to it, so we have different variables depending on the type of email template you're using.
Abandoned Cart Emails
Abandoned carts are not yet orders, so we know about customers and carts. Here are the things you can use:
- {{
action_url
}} (the URL to return a customer back to their cart on your site) - {{
discount
}} (discount code if configured) - {{
cart.first_name
}} - {{
cart.last_name
}} - {{
cart.email
}} - {{
cart.grand_total
}} (raw number) - {{
cart.grand_total_display
}} (formatted string) - {{
cart.last_active_at
}} (date) - {{
cart.products[0].name
}} - {{
cart.products[0].sku
}} - {{
cart.products[0].price
}} (numeric only) - {{
cart.products[0].price_display
}} (formatted with currency code) - {{
cart.products[0].image
}} (path to image URL) - {{
user.currency
}} - {{
unsubscribe_url
}} (the auto-generated unsubscribe link from Recapture)
Post Purchase Emails (all types)
If you're using Post Purchase emails-- it's slightly different. Reviews don't come from carts, they come from orders instead. So you use these in the Post Purchase emails:
- {{
action_url
}} (the URL to return a customer back to their previously completed cart on your site) - {{
discount
}} (discount code if configured) - {{
order.external_id
}} (the order number, platform-specific) - {{
order.first_name
}} - {{
order.last_name
}} - {{
order.email
}} - {{
order.grand_total
}} (raw number) - {{
order.grand_total_display
}} (formatted string) - {{
order.last_active_at
}} (date) - {{
order.products[0].name
}} - {{
order.products[0].sku
}} - {{
order.products[0].price
}} (numeric only) - {{
order.products[0].price_display
}} (formatted with currency code) - {{
order.products[0].image
}} (path to image URL) - {{
user.currency
}} - {{
unsubscribe_url
}} (the auto-generated unsubscribe link from Recapture)
Winback Emails
Winbacks have access to these variables from orders and customers.
- {{
action_url
}} (the URL to return a customer back to their cart on your site) - {{
discount
}} (discount code if configured) - {{
order.external_id
}} (the order number, platform-specific) - {{
order.first_name
}} - {{
order.last_name
}} - {{
order.email
}} - {{
order.grand_total
}} (raw number) - {{
order.grand_total_display
}} (formatted string) - {{
order.last_active_at
}}(date) - {{
order.products[0].name
}} - {{
order.products[0].sku
}} - {{
order.products[0].price
}} (numeric only) - {{
order.products[0].price_display
}} (formatted with currency code) - {{
order.products[0].image
}} (path to image URL) - {{
user.currency
}} - {{
unsubscribe_url
}} (the auto-generated unsubscribe link from Recapture)
Broadcast Emails
- {{
discount
}} (discount code if configured) - {{
customer.first_name
}} - {{
customer.last_name
}} - {{
customer.email
}} - {{
customer.phone
}} - {{
customer.total_order_count
}} - {{
customer.ip_country
}} - {{
customer.language
}} - {{
unsubscribe_url
}} (the auto-generated unsubscribe link from Recapture)
Welcome Series Emails
- {{
action_url
}} (points to the store's homepage) - {{
discount
}} (discount code if configured) - {{
unsubscribe_url
}} (the auto-generated unsubscribe link from Recapture)
Using the Variables Properly
Variables can be used in the body of the email or the subject or both.
Example: Suppose you want to address the user directly by their name instead of just "Hey there!". To do that, you can put something like this in your email:
Hey {{ cart.first_name }}! We noticed that you haven't been back since {{ cart.last_active_at }} and we'd love to see you again...
And you can also use the notion of a "default"--where if the variable is empty, we substitute the default value so it doesn't look weird. Here's an example with a default:
Hey {{ cart.first_name | default('there') }}!
Note for Jilt Users
If you're using Jilt imported templates, the syntax they supported was SLIGHTLY different. This syntax should be converted:
Hey {{ cart.first_name | default: 'there' }}!
Convert it to:
Hey {{ cart.first_name | default('there') }}!
We use SWIG syntax (and we're also Liquid compatible as well) The full SWIG syntax available to you is documented here: http://eddywashere.com/blog/swig-for-designers/