# How to include a discount code in Shopify abandoned cart notification

Let's start with opening your **Shopify admin panel** > **Apps** > **Personal Discount**. Click the **Add automation** button. Then select **Shopify** as your **Email Service Provider** and the **Campaign Type**: **Recover abandoned carts**.&#x20;

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F8qSuHBgtA3d3tLPXhWSm%2Fshopify-abandoned-cart-notification-personal-discount-code-animated.gif?alt=media&#x26;token=f1a87b41-dc93-4fd6-8770-8ceb9ca8c715" alt="Add Shopify recover abandoned carts automation with Personal Discount animated"><figcaption><p>Add recover abandoned carts automation for Shopify</p></figcaption></figure>

Now you can set your automation details. [How to configure discount](https://docs.personaldiscount.io/personal-discount-for-shopify/configure-discount) is a nice article on that.

Meanwhile, you can click the highlighted link. It will open in a new browser tab. We will come back to this in a moment.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FElsmnAdKGJNnYn3pT1u9%2Frecover-abandoned-carts-shopify-personal-discount-code-settings.png?alt=media&#x26;token=4780ec29-d4c2-4fdb-b071-1f9cf22465ac" alt="Navigate to Shopify abandoned cart notification template annotated"><figcaption><p>Navigate to Shopify abandoned cart notification template</p></figcaption></figure>

If you set all parameters, save your automation and copy the code snippet to the clipboard.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FPovWAkLtoBnHj7ayu3Cg%2Fshopify-personal-discount-code-recover-abandoned-carts-code-snippet.png?alt=media&#x26;token=220795d6-375b-4c14-8d60-e4465f725895" alt="Copy the code snippet from Personal Discount annotated"><figcaption><p>Copy the code snippet from Personal Discount</p></figcaption></figure>

In the next step navigate to **Settings** > **Notifications** > **Abandoned checkouts** and insert your code snippet into your confirmation email template. If you are not sure where to place the code snippet, then the safest place is below the following line:

```html
<p>{{ email_body }}</p>
```

You can paste it for example here:

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F3G80w0OmlXz7oIbG7nA3%2Fshopify-abandoned-carts-notification-personal-discont-code.png?alt=media&#x26;token=ba6ba718-61d0-4db4-b52f-b9d7c76925fb" alt="Insert the code snippet into Shopify abandoned cart notification template annotated"><figcaption><p>Insert the code snippet into abandoned cart notification template</p></figcaption></figure>

Now **save** the template changes.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2Fv3ZMGmELJqlkhh4gFH0I%2Fshopify-recover-abandoned-carts-personal-discount-code-notification-template.png?alt=media&#x26;token=d80dc640-2c13-40a2-91bc-dd737c7d889d" alt="Save Shopify abandoned cart notification template annotated"><figcaption><p>Save your template</p></figcaption></figure>

Finally, switch out to the **Abandoned Checkouts** settings that you have opened in a separate browser tab. The most important is to make sure that abandoned checkout emails are enabled for your store. Here you can also set additional options that you can see below.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FR4douoShfsFH3sfNQexr%2Fshopify-personal-discount-code-recover-abandoned-carts-checkout-emails.png?alt=media&#x26;token=f9570455-3716-4d91-82ca-dff89d3edf23" alt="How to enable sending abandoned checkout notification Shopify"><figcaption><p>Enable sending abandoned checkout notification Shopify</p></figcaption></figure>

Thanks to this automation, the chances of a customer completing a purchase in your shop will increase significantly.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FLcvBJFYHBWiYhcPLlHQY%2Fshopify-abandoned-carts-notification-with-personal-sicount-code-email-message.png?alt=media&#x26;token=1a5a4e4e-1c51-454b-bfa1-3125196f11cc" alt="Abandoned cart notification with a discount code"><figcaption><p>Abandoned cart notification with a discount code</p></figcaption></figure>
