Skip to content

How to add discount codes to your emails?

You can easily add discount codes to your email messages created in email editor. This can be done using the dynamic content feature, which allows you to personalize your email messages by inserting the recipient’s name or including unique promo codes.

To add discount codes to your email message, choose one of the following options for dynamic contents:

  • Use discount code – @(Model.UseDiscountCode(discountCodeSetId)) – use this when adding discount codes that have been uploaded to ExpertSender CDP.
  • Get remote content – @(Model.GetRemoteContent(“url”, boolIsUnique)) – use to add discount codes hosted externally, e.g., on your server.

You can access dynamic contents from the email editor while working on your newsletter by following these steps:

  1. Go to Content tab.
  2. Add a text block to your working space.
  3. Enter your message and click it. An edit menu appears above the working space.
  4. Click Merge tags. A pop-up window appears with a list of dynamic content.
  5. Click on a respective dynamic content for your message.
  6. The chosen dynamic content is inserted in your message.

You can style the dynamic content to make it fit your newsletter design.

Use case #1: adding discount codes uploaded to ExpertSender CDP

Suppose you want to send a discount code to your regular customers on their birthdays. Before starting the campaign, make sure to:

  1. Create a discount code set in the platform.
  2. Upload all the birthday promo codes for this campaign to the created set.

Now, create the email message using the following example:

Hi! Today is YOUR BIRTHDAY! 

We have a little gift for you to celebrate this special event: a  personal discount 
code with 20% off our latest sports shoe collection: 
@(Model.UseDiscountCode(2))

The discount code is valid for two weeks.  

Treat yourself to a shiny pair of trendy sneakers   

Cheers!

In this example, we used the dynamic content called Use the discount code: @(Model.UseDiscountCode(discountCodeSetId)).

When the customer opens this email, the dynamic content will be replaced with the first available promo code from the set you have created for this purpose.

To make it work, replace the discountCodeSetId fragment with the ID of the discount code set. In the example, we did it with code set ID 2. It should look like this: @(Model.UseDiscountCode(2)).

Use case #2: adding discount codes hosted on your server

This time, you want to include the discount codes hosted on your server in the email. To do that, you need to use the dynamic content called Get remote content – @(Model.GetRemoteContent(“url”, boolIsUnique)).

Replace the string url fragment with an url address of the file containing the discount codes. The ‘url’ refers to a sequence of characters, including letters, numbers and special characters.

Here is an exemplary email message:

Hi! Today is YOUR BIRTHDAY! 

We have a little gift for you to celebrate this special event: a  personal discount 
code with 20% off our latest sports shoe collection:
@(Model.GetRemoteContent("https://www.myonlinestore.com/uploads/
birthday-promo-codes-20-off", boolIsUnique)). 

The discount code is valid for two weeks.  

Treat yourself to a shiny pair of trendy sneakers   

Cheers!
On this page
To top