# How to add a unique discount code to welcome emails in ActiveCampaign

First, let's prepare a discount automation in Personal Discount. Open **Personal Discount** in your **Shopify admin panel**, and click on **Add automation**. Select **ActiveCampaign** as email service provider and **Welcome new subscribers** as the campaign type.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FbdvD1mOsMtYD8g066gK7%2Fshopify-activecampaign-welcome-campaign-personal-discount-code-animated.gif?alt=media&#x26;token=5f8f7f9d-e22f-4af2-af39-30638fb4b531" alt="How to create welcome Personal Discount automation for ActiveCampaign animated"><figcaption><p>Create welcome Personal Discount automation for ActiveCampaign</p></figcaption></figure>

Specify the discount settings

* code pattern
* discount type
* discount value
* usage limit
* expiration date

according to your needs. Hit **Save** once you are done.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F6kD2YLecuQXdVEgTzuGO%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-discount-details.png?alt=media&#x26;token=8220f9f0-8f20-4625-8494-cfb5f88b9ad2" alt="Save your Personal Discount automation annotated"><figcaption><p>Save your Personal Discount automation</p></figcaption></figure>

Scroll down to the bottom of the settings page, and copy the code snippet. It's enough when you click on the code snippet and then the app will copy it to your clipboard.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FxEfivVZTxiIDFR1UvvAN%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-code-snippet.png?alt=media&#x26;token=9d720d37-815b-43fd-837b-545183b9b666" alt="Copy the code snippet from Personal Discount annotated"><figcaption><p>Copy the code snippet from Personal Discount</p></figcaption></figure>

Now, log in to your ActiveCampaign account and navigate to Automations. If you don't have a welcome email series yet then click on **Create an automation**.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FiFI9wqNTz7JYlcDwXgfA%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-automation.png?alt=media&#x26;token=33bf817c-acbc-4e78-bfa1-d20749ccfb66" alt="Create new ActiveCampaign automation annotated"><figcaption><p>Create new ActiveCampaign automation</p></figcaption></figure>

Filter available recipes by the keyword "welcome". Select **Welcome Series** and click on **Continue**.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FVGgR1UYbcL0EZwVGbrhO%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-automation-type.png?alt=media&#x26;token=41eca7e7-233a-4f58-a9a1-3cf2d88333da" alt="Select a campaign type annotated"><figcaption><p>Select a campaign type</p></figcaption></figure>

You'll see a workflow designer. Click on **Get Started** to let the automation wizard guide you through the initial setup where you specify the email address from which the welcome email is going to be sent.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FaE7eeFcfxtDntzkoSTCa%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-start-automation.png?alt=media&#x26;token=9495160b-53d6-4f08-9bd2-ef7def2f5545" alt="How to configure your ActiveCampaign automation annotated"><figcaption><p>Configure your ActiveCampaign automation</p></figcaption></figure>

Click on the first email in the series. It's the flow element described as **Send an email "Welcome Email"**.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FbDFXSdK4TjxudjzECWsJ%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-send-an-email.png?alt=media&#x26;token=b915e63b-d0ac-4038-8229-1ae5683fa672" alt="How to set sending an email in ActiveCampaign automation annotated"><figcaption><p>Set sending an email in ActiveCampaign automation</p></figcaption></figure>

A pop-up appears where you need to click on **Edit** to open the email template editor.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FVP8sQ5Sp1Fyex3ML3Oj4%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-welcome-email.png?alt=media&#x26;token=55e0d6c2-6acf-49c7-a1bb-7096e666d131" alt="How to edit your ActiveCampaign email template annotated"><figcaption><p>Edit your ActiveCampaign email template</p></figcaption></figure>

In the email editor, drag and drop the **HTML Block** to the desired place in your welcome email.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FDnsYEB7Bog5X6trz7ALK%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-html-block.png?alt=media&#x26;token=4ffe2b27-fdb4-4521-bcd2-fda98f0d307c" alt="How to insert HTML block into your ActiveCampaign email template annotated"><figcaption><p>Insert HTML block into your ActiveCampaign email template</p></figcaption></figure>

Click on the added HTML Block and paste the code snipped copied from Personal Discount.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FQusLcFYeA32CMalY8ZUc%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-code-snippet-paste.png?alt=media&#x26;token=109fffc4-0b6d-49ea-8881-f85bfdfcd283" alt="Edit HTML element and paste code snippet from Personal Discount annotated"><figcaption><p>Edit HTML element and paste code snippet from Personal Discount</p></figcaption></figure>

Click on **Save** and you should see a unique discount code added to your email.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FqMB92RmKYXYLdiLMX5Kb%2Fpersonal-discount-code-email-shopify-app-activecampaign-welcome-new-subscribers.png?alt=media&#x26;token=3cbb85e9-7657-4f95-bde1-17befdff916c" alt="Pesronal Discount code preview in ActiveCmapaign email template annotated"><figcaption><p>Pesronal Discount code preview in ActiveCmapaign email template</p></figcaption></figure>

Click on **Save and exit**. Finally, you can click on **Active** to start sending your welcome series to new subscribers.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FUIYMzXOFHnogNW2CZ80o%2Fpersonal-discount-code-shopify-app-activecampaign-welcome-new-subscribers-activate-automation.png?alt=media&#x26;token=acd1e77a-2153-408c-adce-4b8afea66866" alt="How to activate your ActiveCampaign automation annotated"><figcaption><p>Activate your ActiveCampaign automation</p></figcaption></figure>
