Abandoned carts email template
We use this template for abandoned cart email retrievals, which are sent via an abandoned cart's details in your dashboard. The written message you input in the abandoned cart's details will be automatically inserted into this email template.
Customizing the default template
When you enter the email editor for the first time, you'll have a default template to get started. The actual email related to this template is sent through the dashboard, under an abandoned cart's details. From there, the message you enter will replace the message variable in your template. You will also have access to an object named settings exposing some useful information, such as a URL to retrieve the abandoned cart, available through settings.cartUrl.
If you are using Snipcart on multiple sites with different domains and you need to redirect the customer to the URL where they created the cart, you can use the settings.cartCreatedAtUrl property instead of settings.cartUrl.
The template editor example below includes the message variable you can modify under an abandoned cart's details.
---
Subject: Some items are still in your cart on {{ settings.businessAddress.company }}!
---
<!DOCTYPE html>
<html>
<head>
</head>
<body style="font-family: Arial; font-size: 12px;">
<div>
<p>
{{! You have access to the whole order information using the `order` object. Might be helpful to show some contextual information }}
Hey {{ order.billingAddress.fullName }},
</p>
<p>
We noticed you did not finish your checkout.
</p>
<div>
{{! Use the variable `message` to display the message that you enter in the dashboard when consulting an abandoned cart details screen.}}
{{{ message }}}
</div>
<p>
{{! Using `settings.cartUrl` you can add a link for the customer to retrieve its cart. }}
Follow this <a href="{{ settings.cartUrl }}">link</a> to get back to your cart instantly.
</p>
<p>
If you have any questions, just hit reply.
</p>
<p>
Thanks for shopping with us!
</p>
</div>
</body>
</html>The template receives:
| Variable | Type | Notes |
|---|---|---|
context |
string | Email, Pdf or Html. |
settings |
object | Store settings — see Settings. settings.cartUrl (and settings.cartCreatedAtUrl) link the customer back to their cart. |
order |
Order | The abandoned order. |
message |
string | The custom message you enter in the abandoned cart's details. |
What you can access
| Path | Type |
|---|---|
order |
Order |
order.items[] |
Item |
order.billingAddress |
Address |
order.shippingAddress |
Address |
order.summary |
Summary |
order.summary.taxes[] |
Tax |
order.discounts[] |
Discount |
order.customFields[] |
CustomField |
order.refunds[] |
Refund |
Minimal example
{
"context": "Email",
"message": "You left some items in your cart!",
"settings": {
"businessAddress": { "company": "snipcart.com" },
"cartUrl": "https://snipcart.com?snipcart_token=...#!/cart"
},
"order": {
"email": "john.doe@example.com",
"billingAddress": { "fullName": "John Doe" },
"items": [{ "name": "Geek T-Shirt", "quantity": 2, "totalPrice": 100 }]
}
}