How to Apply a Discount to an Abandoned Checkout Email in Shopify

So you’re sending out abandoned check out emails to your customers, but you haven’t had any luck in recapturing their business.  Frustrating, for sure.

However, there is a simple solution that has been proven time and time again to increase customer return to checkout– applying a discount code in the abandoned checkout email!

This way, you incentivize your customer to return, and when you set up constraints like “ come back in 48 hours and receive a 10% discount using code: abcde” you will notice a boost the volume of your “Recovered” orders.

Step #1: Go to your Shopify admin and click the “Settings” tab:


Step #2: Click on the “Notifications” tab and locate “Email templates”:


Step #3: Click on  the “Abandoned Checkout Notification”:


This will open a pop-up box  that allows you to edit the “Abandoned checkout notification” email template:


Step #4: Scroll down in the template and find {{url}}:


Step #6: Copy the  following code into your clipboard, copy commands: [ (command + c ) on a mac and (ctrl + c) on windows ]

{% if url contains ‘?’ %}
 {{ url | append: ‘&discount=XYZ’ }}
{% else %}
 {{ url | append: ‘?discount=XYZ’ }}
{% endif %}

Step #7: Paste the above code in place of the  {{url}} in the email template:


Step #8: In place of  the XYZ text in the above code,  put a discount code that you have created specifically to recover customers in the discount code area of your backend. Something like “Comeback10” ( get creative with it!)

Step #9: Click the “Save” button once you are done!


There you have it!

Now you know how to add a discount code to your abandoned cart email, do so, and do so quickly– your revenue will thank you.

  • Einardo

    Do you have any tips on how to make this work, only if the cart they abandon has a subtotal of say, over $100?

    Trying to add an if to the abandoned cart template, but not sure how to go about it.