# How to send welcome discount with SendGrid?

SendGrid has a Marketing module which you can use to send an automated welcome email to your new subscribers.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FFaQh6Us6DlXk90kbVjl5%2Fsendgrid-add-welcome-automation.png?alt=media&#x26;token=a2b23d32-0b3e-481f-b69a-20985c3f3e0f" alt=""><figcaption></figcaption></figure>

Make sure that your signup form or popup is adding subscribers to your contact list in SendGrid.

Create a discount automation in Personal Discount selecting "Other" as email marketing provider and "Welcome new subscribers" as campaign type.

Copy the code snippet that you can find at the bottom of the settings page in Personal Discount.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F9XwCAZVQgRaRWEtzSzi6%2Fpersonal-discount-code-snippet.png?alt=media&#x26;token=9e1e96c3-90e4-493e-82f1-a44beddcb48a" alt=""><figcaption></figcaption></figure>

Edit your email template in SendGrid and add a Code block.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F1M1eY2veAy3lTuN3OeRQ%2Fsendgrid-email-template-add-code-block.png?alt=media&#x26;token=831d7027-c23e-4916-80e0-9abb2ea9d50e" alt=""><figcaption></figcaption></figure>

Paste the code snippet you 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%2FcLJxQvwojwZCu8JQcGZH%2Fsendgrid-paste-discount-code-snippet.png?alt=media&#x26;token=3729a455-145a-466e-b372-ef84f5932f32" alt=""><figcaption></figcaption></figure>

Click on Update, and as a result you should see a discount code in your email template.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2F7Iix2ubrXbCdPfPcO5OH%2Fsendgrid-email-template-with-discount-code.png?alt=media&#x26;token=b026e302-034b-4cee-ade3-6a94e637b8bf" alt=""><figcaption></figcaption></figure>

Save the email template, navigate back to your automation settings and click on Set Live to activate the flow.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FcknzYOGtB6lEo2hSztSa%2Fsendgrid-activate-automation.png?alt=media&#x26;token=a275eb45-7ad0-4158-a5e5-9282994778cf" alt=""><figcaption></figcaption></figure>

You can test if it works by manually adding a contact to your list.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FtXSBTakZRR1s4vYTZZtu%2Fsendgrind-add-contact-manually.png?alt=media&#x26;token=4de7e4f5-f70e-45cf-8198-36ed94e353eb" alt=""><figcaption></figcaption></figure>

Some email clients don't show images by default. A recipient has to enable images to see the discount code.

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FcotLch6lI9aSgzWrusFH%2Fwelcome-email-images-not-displayed.png?alt=media&#x26;token=4e8063e1-f84c-47ac-837f-dd218e71ccd0" alt=""><figcaption></figcaption></figure>

After enabling images in the received welcome email you can see the discount code:

<figure><img src="https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZdVZovthV0SPlgxS6Y%2Fuploads%2FEaIuzh9YbtMMg5ip4XnX%2Fwelcome-email-images-enabled-discount-code-visible.png?alt=media&#x26;token=b5893226-536f-47d8-9d38-8fbf35c67131" alt=""><figcaption></figcaption></figure>
