# How to create a pop-up and include a discount code in welcome emails with the Vitals app

Open your **Personal Discount** app and **Add automation**. Select '**Other**' as your email service 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%2FJztMBUhehkpE7apaRlyE%2Fshopify-vitals-welcome-campaign-personal-discount-code-animated.gif?alt=media&#x26;token=0eb2ba5b-d2e7-46f3-bb09-e89ea6297fc0" alt="Add Personal Discount welcome new subscribers automation with Other email service animated"><figcaption><p>Add Personal Discount welcome new subscribers automation with Other email service provider</p></figcaption></figure>

Now fill out the form with automation details. If you need more information about that, here is a useful article on [how to configure discount](https://docs.personaldiscount.io/personal-discount-for-shopify/configure-discount). 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%2FxKQOUcOfEMC4jbAWukDL%2Fcode-snippet-welcome-new-subscribers-campaign-personal-discount-code-shopify-vitals.png?alt=media&#x26;token=c40c8550-adf6-44f7-8c13-34d2c11a69eb" alt=""><figcaption></figcaption></figure>

Switch out to your **Vitals dashboard**. From the left-hand bar, click **Engage customers** then **Email Marketing**.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FM5vrzhQkb3hpuE5B7QmV%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-dashboard.png?alt=media&#x26;token=ad9f21b3-fef6-45b1-b800-e726896aeef6" alt=""><figcaption></figcaption></figure>

Open the **Welcome** automation.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FNPgMrdlPjrIwFE1BCiIL%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-automation.png?alt=media&#x26;token=f4d796ca-b545-4abe-a53e-4032ed2b0f2a" alt=""><figcaption></figcaption></figure>

Now enable your automation status and decide how many messages will be sent to your customer. In that case, one is enough. You can disable **Message #2** and **Message #3**. Edit **Message #1** which will contain a discount code.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FfHnrlRgtA4Fnr1bjSLS5%2Fwelcome-new-subscribers-campaign-messages-personal-discount-code-shopify-vitals.png?alt=media&#x26;token=665c0a9a-0737-48f6-8ca4-bdc13e8df57c" alt=""><figcaption></figcaption></figure>

Set config for your message then go to the content. To include the discount code into your mail you need to drag and drop the **HTML element**, as 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%2FKVNOt4TVktGwOPOuQIi7%2Fwelcome-new-subscribers-campaign-HTML-element-personal-discount-code-shopify-vitals.png?alt=media&#x26;token=42e48a11-5c52-4802-96d6-823ed8cee8ba" alt=""><figcaption></figcaption></figure>

Delete the existing code snippet and paste the one from your Personal Discount automation.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FRehaM0DQzwQmxhPcGOGD%2Fwelcome-new-subscribers-campaign-personal-discount-code-snippet-shopify-vitals.png?alt=media&#x26;token=95428b13-4f5d-45c3-96f0-731560619d33" alt=""><figcaption></figcaption></figure>

Now you need to modify this code snippet a bit. Delete **{{email}}** and paste\
\&#xNAN;**{{ customer\_email }}** in two places marked below.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F7dbZAPe2VJs99XtDHEAI%2Fwelcome-new-subscribers-campaign-personal-discount-code-snippet-modify-shopify-vitals.png?alt=media&#x26;token=ddb892ee-ad67-4d73-b822-222f44f156a3" alt=""><figcaption></figcaption></figure>

**Save** all changes.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FrTrS09z1QQIcNyRBEJyQ%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-save-changes.png?alt=media&#x26;token=d12378a4-5b1d-4384-ab47-e8ccf081e286" alt=""><figcaption></figcaption></figure>

Don't forget to enable the **Email Marketing** app.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2Feh46qKJ7Pbqzq8B3NOaz%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-enable-email.png?alt=media&#x26;token=1ff55ebe-0fcc-4d0c-947c-93dc90886aea" alt=""><figcaption></figcaption></figure>

Now create your pop-up. Go to **Capture Leads** > **Pop-up**. Click '**Create**' and select **Lead Capture** type.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F29zzVpu1QptZTbygqT1h%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-popup.png?alt=media&#x26;token=78d9a714-bbbe-4954-9e26-deb58f42001d" alt=""><figcaption></figcaption></figure>

Customize your pop-up template. Enable this one and save all changes.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FICrAkRSrZJJh7gBFL3LA%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-popup-template.png?alt=media&#x26;token=2168c5a5-b27a-423f-a63d-6f804f3b15f1" alt=""><figcaption></figcaption></figure>

Also, enable the pop-up app. If something doesn't work as you expected, visit the '**Settings**' tab.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FL21hidwYUcHTCaQI2h9o%2Fwelcome-new-subscribers-campaign-personal-discount-code-shopify-vitals-enable-popup.png?alt=media&#x26;token=a005ab69-1a06-41bb-812f-8409749027d3" alt=""><figcaption></figcaption></figure>

Now you can test the behavior of your automation. A unique discount code will be included in an email message.
