All Collections
Magento Open Source and Adobe Commerce
Dynamic content
Use dynamic content coupon codes in Magento Open Source and Adobe Commerce
Use dynamic content coupon codes in Magento Open Source and Adobe Commerce

Learn how to set up and insert dynamic coupon codes with Dotdigital and Adobe Commerce.

Gareth Burroughes avatar
Written by Gareth Burroughes
Updated over a week ago

Using coupon codes generated by an external dynamic content URL lets you include unique, single-use coupon codes within your email campaigns. It’s a great way to incentivise your contacts to shop on your Adobe Commerce (previously Magento 2) store with coupon codes, without the risk of the codes being shared and abused.

Before you start

Things you need to know:

  • We advise you only use external dynamic content coupon codes in triggered campaigns with low concurrent sends, such as welcome campaigns.

Sending campaigns with dynamic content coupon codes

We advise that you consider using send throttling for campaigns containing a dynamic coupon code. This will help to prevent performance issues with your site related to a large number of simultaneous requests to your servers. Learn more in Throttle the sending of an email campaign.

If you're planning to send the campaign through an automated program which is likely to have large numbers of contacts enrolling at one time, you may want to consider using quantity splits and delay nodes to stagger the sends. Learn more in Use quantity splits in programs and Add a delay node to a program.

1. Set up Cart price rules

First you need to set up cart price rules for your coupon code:

  1. In your Adobe Commerce account, go to Marketing > Cart Price Rules, then select Add New Rule.

  2. Under Rule information, enter a Rule name and Description for your rule.

  3. Switch the Active toggle to Yes.

  4. For Websites, choose the websites you want this code to be valid on.

  5. For Customer Groups, choose the customer groups you want to be able to use this code.

  6. Expand the Coupon drop-down menu, then select Specific Coupon.

  7. For Coupon code, select the Use Auto Generation checkbox.

  8. For Uses per Coupon and Uses per Customer, enter 1.

  9. If you have a promotion with a specific end date, choose a From and To date for your code.

    If you want the code to expire after so many days, leave this blank, and we can set an expiry later.

  10. Select Save and Continue Edit.

2. Generate a Dotdigital Coupon URL

Next, you generate your coupon code URL to use in your campaign as external dynamic content. You must generate your Coupon code URL in one step. Saving at this point won't save any of your details.

To generate a coupon code URL:

  1. Under Cart price rules, select the rule you created in Step 1.

  2. Expand the Dotdigital Coupon URL Builder settings menu.

  3. Expand the Code Format drop-down menu, then choose Alphanumeric, Alphabetical, or Numeric.

  4. If you want, enter a Code Prefix or Code Suffix.

  5. If you want your code to expire, for Expires After (days), enter the number of days you want your code to expire after.

  6. Expand the Allow Resend drop-down menu, then choose Yes or No.

    1. Yes - allows a Resend using the same code.

    2. No - Generates a new code with a Resend.

  7. If you selected Yes in the previous step, expand the Cancel Send if Used drop-down menu, then choose Yes or No.

    1. Yes - Cancels the send if the coupon code has been used, or regenerates a code if it has expired.

    2. No - The latest generated coupon code is displayed.

  8. Leave your browser tab open and do not Save at this point, or you will lose your settings.

  9. In the Coupon Codes URL box, select the URL to copy it to your clipboard.

    Paste and store the URL in notepad or a similar application as you need it in the next step.

3. Add a dynamic coupon code to an email campaign

To add an external dynamic coupon code to your email campaign:

  1. In your Dotdigital account, go to Campaigns > Email.

  2. Edit an existing campaign or create a new campaign.

  3. In EasyEditor, from the Build > Building blocks > Tools menu, drag the External dynamic content block onto the EasyEditor canvas.

  4. Select the External dynamic content block to open the left-side settings.

  5. For Name, enter a name for the block.

  6. For Address, paste the Coupon Code's URL you generated and copied earlier.

  7. Finish editing your campaign and save ready for sending.

Style your coupon codes

You can customise the font and style of the coupon codes you generate.

4. Test send

We advise you send your dynamic coupon code email to yourself or other members of your team before sending it to your contacts.

Learn more in Dynamic content.

Did this answer your question?