Create unique coupon code collections to include in your email campaigns

❗️ Important
This feature is only accessible to our Enterprise users using API or with an updated WooCommerce (v4.0.0) or PrestaShop (v5.0.0) plugin, or Shopify plugin. We will progressively launch it for other plugins.

A unique coupon code, also called dynamic coupon code, is a promotional code that can only be used once on an eCommerce website and is unique for each client.


The Coupon collections dashboard allows you to import your unique coupon codes from your eCommerce platform to Brevo and include them in your email campaigns. Each of your email campaign recipients will be assigned their own unique coupon code that can only be used once.

This strategy helps secure your campaign budget and prevent fraud, such as the reuse and distribution of promotional code. Additionally, unique coupon codes typically perform better and are easier to track since they are individually assigned.

Before you start 

  • Contact your Customer Success Manager (CSM) to enable the Developer mode if you use the Drag & Drop Editor. Else, use the HTML editor to create your email.
  • Create the email template in which you want to add a product feed. To learn more, check our dedicated article Create an email template
  • If you already have a file containing unique coupon codes:
    • Ensure the file is saved in a CSV format with a maximum size of 2MB and each data separated with a comma.
    • Ensure that the coupon codes in the file are synced with your eCommerce platform for them to work on Brevo.
      If your file meets the above requirements, you can directly follow the procedure from Step 2: Create your coupon code collection on Brevo.

📁 Step 1: Generate a file containing your unique coupon codes 

To be able to create your coupon code collection on Brevo, you have to generate a file containing a list of coupon codes for your eCommerce platform and save them in a .csv file. 

The coupon code file must meet the following requirements:

  • Format: CSV
  • Size: maximum 2MB
  • Separator: comma separated data

Depending on your eCommerce platform, the procedure to generate a unique coupon code file can differ: 

Shopify and WooCommerce API

Use a coupon code generator app to generate coupon codes in bulk and automatically sync your coupon codes with your eCommerce platform: 

Shopify WooCommerce

To generate coupon codes in bulk:

  1. Log in to your Shopify or WooCommerce platform.
  2. Install the coupon code generator app compatible with your eCommerce platform.
  3. Define your coupon codes terms and conditions of use and format.
  4. Generate your coupon codes in bulk.
  5. Export your coupon codes in a .csv file. 
  6. Once you have exported your coupon codes in a .csv file, import it into Brevo.

Once your coupon codes are generated and saved in a file, you can create the coupon code collection on Brevo ⬇️.

📥 Step 2: Import your coupon codes in Brevo 

1️⃣ Create your coupon code collection

  1. On Brevo, go to E-commerce > Coupon collections and click Create a coupon collection
  2. Give a short name to your coupon collection. In this use case, we will name it 20offall.
    Your coupon collection name cannot contain spaces and cannot be edited later as it will be used in the code of your email design.
  3. Enter a fallback coupon code that will be used if you run out of coupons or if your coupon expires. In this use case, we will use N/A.
    This fallback coupon code will be sent to your recipients instead of a unique coupon code to indicate that the maximum number of coupon codes has been reached or that the code is no longer valid. 
  4. Optional: Toggle the Define an expiry date for this collection option and select a date at which your coupon collection code will no longer be valid. 
  5. Optional: Toggle the Receive a notification before I run out of coupons option to define thresholds at which you want to be notified: 
    1. To receive a notification before your coupons run out, check the first option and enter the threshold at which you want to be notified. For example, enter 1000 to be notified when you have 1000 coupons left. 
    2. To receive a notification before your coupon collection expires, check the second option and enter the number of days prior to the expiry date when you want to be notified. For example, enter 20 to receive a notification 20 days before your coupon collection expires. 
  6. Click Continue.
  7. Browse files on your computer, and upload the one containing your coupon codes. 
  8. We automatically detect the header and columns in your file. If your first row is a header column, ensure it has been automatically detected as such by our system. Otherwise, toggle First row is a column header.
  9. Select the column that contains your coupon codes. 
  10. Click Upload coupons.

Your coupon collection can be found in your Coupon collections dashboard. Depending on the number of coupon codes to upload, the process may take some time.

Once all your coupons have been imported, you can add them to your email campaigns ⬇️.

📧 Step 3: Use your unique coupon code collection in your email

1️⃣ Connect your product feed to your email

Create an email campaign or template and access the Design step. Depending on the design tool you chose, the steps and syntax to connect your coupon code collection to your email template are different: 

Drag & Drop Editor HTML editor
  1. From the Drag & Drop Editor, click more-action-icon.png  > Developer mode to open the code editor.
  2. Copy the following placeholder and paste it after the subject line:
       name: variablename
       source: couponname
  3. In this placeholder, replace:
    • variablename with a name for your variable that will later give you access to your data in the email design. In this use case, we will call it uniquecoupon
    • couponname with your coupon collection name. In this use case, it is 20offall.
      ❗️ Important
      Be careful to write the couponname exactly how it appears in your coupon collection setup as it is case-sensitive. For example, if your feed name is 20offall and you write 20OffAll, the connection between your email template and your coupon code collection will fail. 
  4. Close the developer mode by clicking the close icon X.

2️⃣ Access the coupon code collection in your email

Your coupon code collection is set up and connected to your email template. It is now time to access the data contained in your coupon code collection to display it. Each data will be called separately with variables according to the information you want to display.

Depending on the design tool you chose when creating your email, the steps and syntax to access your coupon code collection are different: 

Drag & Drop Editor HTML editor
  1. From the Drag & Drop Editor, insert a text content block where you want to display your coupon code. 
  2. Copy the following placeholder:
    {{ }}
  3. In your text content block, paste the placeholder. Leave coupon as is and replace variablename with the variable name you previously used in the developer mode. In this use case, it is uniquecoupon.
    Drag & Drop Editor Email preview
    dde_coupon-code-syntax_EN-US.png dde_coupon-code-example-replaced_EN-US.png
  4. Once you are done designing your email template, click Save & Quit

3️⃣ Test your email 

To ensure that your email content will display correctly in your recipients' inboxes, we highly recommend testing your email template. The best way to test an email template with product feed data is to send a test email. To learn more, check our dedicated article Preview and test your email campaign.

❓ FAQs

🪫 If I run out of coupon codes, can I upload more?

Yes, if you run out of coupons, go to your Coupon collections dashboard and click Upload more next to the coupon collection you want to reload. Follow the procedure to Upload your coupon codes file to Brevo.


✍️ Can I edit my coupon collection expiry date and settings?

Yes, you can edit all the settings of your coupon collection at any time except for its name as it is used in your email campaign design code. To edit your coupon collection settings, click the pen icon pen-edit-icon.png  next to its name. You will access the same settings as when you created your coupon collection

🗑️ Can I delete unused or expired coupon collections?

No, you cannot delete your unused or expired coupon collections at the moment.

⏭️ What's next? 

🤔 Have a question?

If you have a question, feel free to contact our support team by creating a ticket from your account. If you don't have an account yet, you can contact us here.

If you’re looking for help with a project using Brevo, we can match you with the right certified Brevo expert partner.

💬 Was this article helpful?

1 out of 1 found this helpful