Dynamic content: Coupon codes - Magento 1


Setting up coupon codes


Using our coupon codes external dynamic content URL allows you to include unique, single-use coupon codes within any email you want to.

This will allow you to incentivise your contacts with coupon codes without the risk of the codes being shared and abused.

Setting up coupon codes

Firstly you need to create a valid shopping cart price rule in Magento. This can be found in Promotions > Shopping Cart Price Rules.

When creating a new rule, you need to ensure you select that a specific coupon must be used and you want to use auto generation.

Once this is done and you have set up the rule, including the conditions and actions if required, you need to save the rule and then copy its ID. This can be found here:

You can then insert the coupon code URL we provide (which is found by going to System > ConfigurationDOTMAILER > Dynamic Content) into your Engagement Cloud campaign and replace the part of the URL that says [INSERT ID HERE] with the ID you copied.

You can also set an expiry for the coupon in the URL. This is done by replacing the part of the URL that says [INSERT NUMBER OF DAYS HERE] with a number. Therefore, if you insert the number 30 there, then the coupon code will expire after 30 days and will no longer work if used during a checkout after that time.

The expiry countdown begins at campaign send time, which is when Engagement Cloud first makes use of the URL to generate the coupon code.  

Entering 0 will result in setting no expiry time at all. 


What does the format of the coupon codes look like and can it be changed?

The coupon codes we generate are always in the format of DOT-AAA-AAA-AAA.  The format including the prefix (DOT) can't be changed at this time.

Can I alter the font and style of the coupon codes you generate?

You certainly can - find out about dynamic content styling options.

Please comment underneath with any further questions you may have.

Magento 2.0

The above also applies for Magento 2.0, with the only difference being that the dynamic content URLs can be found by going to Stores > Configuration > DOTMAILER > Dynamic Content.


Have more questions? Submit a request


  • Avatar

    What if I wanted to send a customer an exclusive promo code, and send this code again a couple of weeks later if the customer hadn't used it yet? The above suggests that the system generates a new code every time. Is there a work around this?

  • Avatar

    Hi Thomas. Thanks for your question. Yes, a new coupon code is generated every time the email’s dynamic link is clicked upon.

    However, selecting ‘Specific Coupon’ and clicking ‘Auto Generation’ ensures the coupon code generated for the rule is one use per customer. So even if x amount of different coupon codes get generated by a customer clicking on the dynamic link sent to them numerous times, these are all part of the same coupon rule (ID) for that customer. If they were to redeem the coupon and then try to redeem it again with a differently generated code, they wouldn’t be able to.

    This means you could send an email two weeks later containing an external dynamic content link with the appropriate ID for the coupon code in question, and it can still be used exclusively by any customer receiving it.

  • Avatar

    Thanks Neal. That makes sense, we will test this one out asap!

  • Avatar

    Hi Neal,
    So to confirm, if you send a reminder email with a coupon code, it wont be the same code but will only work if the customer hasn't used their previous one already?

  • Avatar

    Hi Fiona. Yes, that's correct. Sending a reminder will result in the customer generating a new coupon code when they click on the dynamic link. This coupon code will work if the customer hasn't already redeemed the coupon prior to this.

  • Avatar

    Hi Neal, maybe I'm missing something, but I can't really understand the logic of this service. Please help me.
    I'd like to send emails with coupon codes to anyone who subscribed using this pop-up https://prnt.sc/gq15uw
    What should be done in order to trigger coupuns sending? By the way, I tried to use the link connector/email/coupon/id/1/code/secret/expire_days/60/stas.goncharenko@blackridgesoftware.com to test the extension and here is what I see: dotmailer does generates a coupon code for me https://prnt.sc/gq172s , but it doesn't sen any email. Please help me to understand the workflow of your service. Thank you.

  • Avatar

    Hi Stas. Thanks for your question. Yes, for this to work correctly, you'd need to follow these steps:

    1. Create a triggered campaign in dotmailer. This support article explains how to do this - https://support.dotmailer.com/hc/en-gb/articles/212214008-Creating-a-triggered-campaign
    2. Add the coupon code's external dynamic content link within it. This support article lets you know how to add an external dynamic content block to a campaign in EasyEditor - https://support.dotmailer.com/hc/en-gb/articles/212212948-Working-with-external-dynamic-content.
    3. Next, in 'Stores' > 'Configuration' > 'DOTMAILER' > 'Automation' in Magento, you need to set new subscribers to receive the triggered campaign you've created. This is outlined here - https://support.dotmailer.com/hc/en-gb/articles/216846787-Automation-enrolment.

    I hope that helps to clarify the workflow for you.