> For the complete documentation index, see [llms.txt](https://docs.personaldiscount.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.personaldiscount.io/personal-discount-for-shopify/integrate-personal-discount-with-your-email-service-provider/shopify-notifications/how-to-include-a-discount-code-in-shopify-abandoned-cart-notification.md).

# 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="/files/v7Ql3ErPorIfM8Wo41Kl" 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](/personal-discount-for-shopify/configure-discount.md) 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="/files/Yfs4AbCnjxbT8ZX1jIn1" 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="/files/NZEdYQkW1zii2X9EPELn" 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="/files/NwhcCtMeVenGApaQ5CJg" 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="/files/28SQZ9fSx0h06OhQu8Y3" 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="/files/jNRr50ZvRN1GdXamx89R" 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="/files/KKVGw5ZMbZGcpYFlxVpd" alt="Abandoned cart notification with a discount code"><figcaption><p>Abandoned cart notification with a discount code</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.personaldiscount.io/personal-discount-for-shopify/integrate-personal-discount-with-your-email-service-provider/shopify-notifications/how-to-include-a-discount-code-in-shopify-abandoned-cart-notification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
