# How to send welcome emails with discount codes for new subscribers via Ontraport?

[Personal Discount](https://apps.shopify.com/personal-discount) is highly-rated application to create unique discount codes. With Ontraport, you can automate sending emails. How to integrate them to get a great marketing campaign? Here we go.

#### Set up a discount automation in Personal Discount

Open your Shopify dashboard > Apps > Personal Discount and add a new automation. Select Ontraport from the list of Email Service Providers. Pick the campaign type 'Welcome new subscribers'.&#x20;

<figure><img src="/files/cTBFzrb6QONUOuPwp0RH" alt=""><figcaption></figcaption></figure>

Next, specify discount details. At the bottom of the automation settings page, you'll find a code snippet. You'll need to copy and paste it into an email template in further steps.

<figure><img src="/files/f9vmKtgXOl3yuhUOaka7" alt=""><figcaption></figcaption></figure>

#### Configure newsletter signup automation in Ontraport

Now switch over to your Ontraport dashboard. Click the 'Automations' button.

<figure><img src="/files/R89aSgaHWEEH5krTeB6q" alt=""><figcaption></figcaption></figure>

Then create a new automation. Ontraport has predefined automation templates for new subscribers. In this step select the proper one from the list.

<figure><img src="/files/LKvoQqLTnjp8briPmkQY" alt=""><figcaption></figcaption></figure>

You can see several branches and it could seem complicated but don't worry.&#x20;

<figure><img src="/files/CEqnf7Fw6YCqLPZlObVN" alt=""><figcaption></figcaption></figure>

In our case two of them are unnecessary that you can delete.

<figure><img src="/files/Fh7oVwr9zCUeHAqr0Rca" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7RxRHtpH7yMs28wbOTK0" alt=""><figcaption></figcaption></figure>

Now your automation looks more friendly. Following elements with the red dot have required settings that must be set before publishing.

<figure><img src="/files/4Kk2XRSg9t78wKlQULEJ" alt=""><figcaption></figcaption></figure>

**Set up a sign-up form**

Let's start with the 'Submits form'. Click that and set triggers.

<figure><img src="/files/ZMGwKogqZN6rz6Ew4dBE" alt=""><figcaption></figcaption></figure>

Create a new form or pick the existing one. The recipients will get an email with a discount code after filling out this form.

You can use Ontraport templates that could be modified easily or create your own.

<figure><img src="/files/icd7TDlaqIOjhG7f0Hve" alt=""><figcaption></figcaption></figure>

Publish your form and put it on your page. Follow the instruction – attach the code snippet from Ontraport to include the form on your website.

<figure><img src="/files/9JtoGXPFnIv3u9LIP9EW" alt=""><figcaption></figcaption></figure>

![](/files/dRD1QREmfaOgdVzDN0Ks)

**Prepare your welcome email template**

If your form is ready, you need to prepare your email template with a discount code. Modifying it is similar to creating the form template – you're just working with blocks. So click the element 'Sent email' in your automation.

<figure><img src="/files/PNWgzNn0fp1V6mpRND0B" alt=""><figcaption></figcaption></figure>

From the drop-down menu select an email template or create a new one.

<figure><img src="/files/eLhWDAui4W5hNV5lmPvu" alt=""><figcaption></figcaption></figure>

Choose RAW HTML template type.

<figure><img src="/files/MDHmjKgj6jyjuq6qgnwE" alt=""><figcaption></figcaption></figure>

Prepare your email template. Switch on the source view and paste the code snippet from Personal Discount. Then click Save at the right-top.

<figure><img src="/files/oZcEnNkfizhU5xL1qFBR" alt=""><figcaption></figcaption></figure>

Click Publish to start the automation. If you want to activate it later, click Save.

<figure><img src="/files/JBuiZLhhLMpBoni0NN8I" alt=""><figcaption></figcaption></figure>

Well done! Now your new subscribers can enjoy the discount.&#x20;


---

# Agent Instructions: 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:

```
GET https://docs.personaldiscount.io/personal-discount-for-shopify/integrate-personal-discount-with-your-email-service-provider/ontraport/how-to-send-welcome-emails-with-discount-codes-for-new-subscribers-via-ontraport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
