> 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/mailchimp/create-a-link-to-apply-discount-automatically.md).

# Create a link to apply discount automatically

Shopify provides the mechanism of [shareable discount links](https://www.shopify.com/blog/shareable-discount-links). In a nutshell, when your customers click such a link, then they are redirected to your store homepage, and the discount is automatically applied at checkout.

When you use an email marketing service other than Mailchimp, then Personal Discount gives you a code snippet that already works like the shareable discount link.

If you use Mailchimp, then you'll need to prepare a sharable discount link manually. To do the trick you need to construct the link in your email template as follows: `https://{shop_name}.myshopify.com/discount/*|DSCNT_CODE|*` where `{shop_name}` should be replaced with your shop name.

<figure><img src="/files/To4J5CEJDc2B6XDBbYTw" alt="Email template sharable discount link for Shopify"><figcaption><p>Email template with sharable discount link for Shopify</p></figcaption></figure>

A final email will look for example like this:

<figure><img src="/files/quiD8Wz4NEAKligjtpiA" alt="Email template sharable discount link for Shopify annotated"><figcaption><p>Discount code in Mailchimp displayed as a sharable link</p></figcaption></figure>

When the link is clicked then the discount will be automatically applied at checkout:

<figure><img src="/files/9cb7imASBr6neQQaA4O7" alt="Sharable discount link to Shopify checkout annotated"><figcaption><p>Sharable discount link to Shopify checkout</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/mailchimp/create-a-link-to-apply-discount-automatically.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.
