Sending Coupon code

Note: if you are using mailchimp extension and sending the emails through it you can skip this step.

Create new email template

First you have to create new email template which will be used as "Newsletter Subscription Success" email template.

1. You can create new template here:

Marketing >> Comunication >> Email Templates >> Add New Template

2. Load default template called: "Subscription success"
3. Enter template name, for example: "Subscription success with discount code"
4. Enter template subject, for example: "Newsletter subscription success"
5. Insert coupon code variable to the template:
{{var subscriber.getNpDiscountCode()}}

Your email content should look like:
{Error in template processing}
{{trans "You have been successfully subscribed to our newsletter."}}
{{trans "Your coupon code:"}} {{var subscriber.getNpDiscountCode()}}
{Error in template processing}

Do not forget to save the template.

Set newsletter subscription success message template

Please go to:

Stores >> Configuration >> Customer >> Newsletter >> Subscription Options

And choose the new template in this field: "Success Email Template".