- Create coupon generator.
- Create block flexdiscount.mailer in Site - Blocks with the contents:
{if $wa->shop} {shopFlexdiscountPluginHelper::generateCoupon(1)} {/if}
Pay attention, instead of digit 1 you have to specify ID of your generator. - Copy block code and insert it into your mailer message
{$wa->block('flexdiscount.mailer')}