Add Shopify coupon codes to an email campaign

Learn to add and set up the dynamic coupon code block to send a unique Shopify coupon code to all your campaign contacts.


If you're using a Shopify store connected to Dotdigital with our Shopify connector, you can create individual and one-time use dynamic coupon codes to send to your contacts in email campaigns.

Shopify API rate limits

Please be mindful of your Shopify API rate limit. API calls are made to obtain the coupon code. Sends can become cancelled if the limit is exceeded.  Consider throttling your sends.

Watch the video



Before you start

Things you need to know:

  • You must have a Shopify store connected to Dotdigital using our Shopify connector.
  • You need to create or edit a campaign in Dotdigital to add the coupon code block.
  • There's a Shopify limit of 20 million unique coupon codes for each store, and every coupon code sent in a campaign deducts from this quota. If you reach this limit, and want to create more, you must delete coupon codes from your Shopify admin.
    To learn more, and to read about other coupon code considerations, check out the Shopify article Considerations for creating discount codes.

Add Shopify coupon codes to an email campaign

To add and set up the dynamic coupon code block:

  1. Go to Email campaigns > All email campaigns, and then either select CREATE NEW to start a new campaign, or select an existing campaign to edit it.
  2. In EasyEditor, drag the Coupon code block onto your campaign canvas.
    You can find the Coupon code block under the Ecommerce header of the EasyEditor building blocks.
  3. Hover over the Coupon code block and select the settings icon

    This opens the Coupon code block settings side panel. 
  4. In the Coupon prefix box, enter some text to personalise your coupon.
    For example, SUMMER2020, SAVE10, or BLACKFRIDAY. 
  5. Under the label Discount type, expand the drop-down menu and choose either Percentage, Fixed amount, or Free shipping.
  6. In the Amount box, enter the amount of discount you want to give.
    For example, if you selected Percentage for the Discount type, you might enter 20 to add a 20% discount to the coupon.
  7. If you want the coupon code to only work on orders above a minimum value, enter a minimum value amount in the Minimum order value box. Enter 0 if you don’t want to use a minimum order value.
  8. To make the coupon only valid for certain product collections, enter the collection ID into the Eligible collections box. To add multiple collections, separate the IDs using commas (,).
    To find the collection ID in your Shopify admin, go to Product > Collections and select the collection you want to use. You can find the ID at the end of the URL in the address bar.
  9. To set an expiry time for your coupon, enter a number (in days) into the Expires after (days) box. By default, this is set to 30 days.
  10. Select Apply to finish.

You’ve now finished setting up the dynamic coupon code in your email campaign. Once you complete and send your campaign, all your contacts receive a unique coupon code in their email.

You can’t preview a dynamic coupon code

When previewing or testing the campaign, you only see a placeholder for the campaign and the unique code is not entered. This is because coupon codes are generated and inserted only when sending a real campaign.

Did you find this article helpful?

Can we help?

Thanks for using Dotdigital. If you need more help or support, then contact our support team.