Automatically apply discounts to abandoned checkout recovery emails
You can automatically apply a discount to your abandoned checkout recovery emails. When you apply a discount to your abandoned checkout emails, your customers are emailed a pre-filled cart at a discounted price. Customers only need to enter their payment details to complete checkout.
Before you begin
To get started setting up a discount for abandoned checkout recovery emails:
Steps:
Create a percentage discount code or a monetary discount code according to the type of promotion you want to offer.
-
Make sure to make a note of the name you give your discount code when you create it, for example
WelcomeBack
. You assign a name to your discount code when you create a discount. Verify that your abandoned checkout recovery emails are configured to your liking on the Checkout page.
Edit the abandoned checkout recovery notification
- From your Shopify admin, go to Settings > Notifications.
- From the Shopify app, go to Store > Settings.
- Under Store settings, tap Notifications.
- From the Shopify app, go to Store > Settings.
- Under Store settings, tap Notifications.
Under Orders, click Abandoned checkout.
-
In the Email body (HTML) area, find the line that includes the following code:
<td class="button__cell"><a href="{{ url }}" class="button__text">Items in your cart</a></td>
-
Copy the code snippet below:
{% if url contains '?' %}{{ url | append: '&discount=ABC' }}{% else %}{{ url | append: '?discount=ABC' }}{% endif %}
Paste the code snippet to replace
{{ url }}
.-
Find the line that includes the following code:
<td class="link__cell">or <a href="{{ shop.url }}">Visit our store</a></td>
-
Copy the code snippet below:
{{ shop.url | append: '/discount/ABC' }}
Paste the code snippet to replace
{{ shop.url }}
.-
Replace each instance of
ABC
with your discount code, for exampleWelcomeBack
. Your code should look like this:<tr> <td class="actions__cell"> <table class="button main-action-cell"> <tr> <td class="button__cell"><a href="{% if url contains '?' %}{{ url | append: '&discount=WelcomeBack' }}{% else %}{{ url | append: '?discount=WelcomeBack' }}{% endif %}" class="button__text">Items in your cart</a></td> </tr> </table> {% if shop.url %} <table class="link secondary-action-cell"> <tr> <td class="link__cell">or <a href="{{ shop.url | append: '/discount/WelcomeBack' }}">Visit our store</a></td> </tr> </table> {% endif %} </td> </tr>
Click Save.
Now all abandoned checkout recovery emails will have URLs ending in discount=WelcomeBack
or /discount/WelcomeBack
and that discount is automatically applied to their checkout. Make sure you have set up your discount code in order for it to apply properly.