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:

  1. Create a percentage discount code or a monetary discount code according to the type of promotion you want to offer.

  2. 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.

  3. Verify that your abandoned checkout recovery emails are configured to your liking on the Checkout page.

Edit the abandoned checkout recovery notification

Steps:

  1. Under Orders, click Abandoned checkout.

  2. 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>
  3. Copy the code snippet below:

    {% if url contains '?' %}{{ url | append: '&discount=ABC' }}{% else %}{{ url | append: '?discount=ABC' }}{% endif %}
  4. Paste the code snippet to replace {{ url }}.

  5. Find the line that includes the following code:

    <td class="link__cell">or <a href="{{ shop.url }}">Visit our store</a></td>
  6. Copy the code snippet below:

    {% if shop.url contains '?' %}{{ shop.url | append: '&discount=ABC' }}{% else %}{{ shop.url | append: '?discount=ABC' }}{% endif %}
  7. Paste the code snippet to replace {{ shop.url }}.

  8. Replace each instance of ABC with your discount code, for example WelcomeBack. 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="{% if shop.url contains '?' %}{{ shop.url | append: '&discount=WelcomeBack' }}{% else %}{{ shop.url | append: '?discount=WelcomeBack' }}{% endif %}">Visit our store</a></td>
          </tr>
        </table>
        {% endif %}
      </td>
    </tr>
  9. Click Save.

Now all abandoned checkout recovery emails will have URLs ending in 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.

Ready to start selling with Shopify?

Try it free