Email Codes - Adding unique codes to email templates
This article explains Uniqodo’s functionality for adding unique codes into email marketing templates. The unique codes are displayed as images in the email being sent and the images are generated dynamically when the recipient opens the email. An example of how the codes display is below.
Best Practice Checklist
- Add the HTML to your email template and make sure the email address placeholder is setting the email address correctly on the image and the link parts of the HTML.
- Test this by sending a test email to multiple recipients and make sure that each recipient receives their own unique code
- Add a call to action button next to the unique code image that the recipient should click
- Add unique code carry through to all of the links in your email that link to your website (see "Adding codes to other links" section).
- It is important to test one of the unique codes issued in a test email to make sure that the promotion is active and the codes are redeemable and applying the promotion
- The promotion does need to be active in the Uniqodo system for the unique code to trigger the promotion correctly
- You should attempt to enter a code issued in the email in the booking/checkout process to ensure that codes issued are working correctly
An example of unique codes being issued by Travelodge.
Integration
When a promotion is setup on Uniqodo and "email codes" is chosen as the distribution method, an email containing the standard HTML will be sent to the email set against the promotion. This email will also be sent to the user setting up the promotion. The HTML supplied in the email will be pre-set with the promotion ID.
The standard HTML below should be copied and pasted in to the body HTML of the email being constructed in your email service provider’s platform. The Promo Code HTML should be pasted in to the email body HTML in the position where you wish the Promo Code to be displayed.
Standard HTML
<a href="https://email-code.uniqodo.com/code-claim/click?e=!!!EMAIL!!!&d=!!!DATETIME!!!&p=!!!PROMOTION!!!&u=!!!URL!!!">
<img src="https://email-code.uniqodo.com/code-claim/email?e=!!!EMAIL!!!&d=!!!DATETIME!!!&p=!!!PROMOTION!!!&u=!!!URL!!!">
</a>
Basic Parameters
The table below explains each parameter and provides an example of value and format.
Parameter | Placeholder | Description | Requirement |
e= | !!!EMAIL!!! | The email address of the recipient of the email. This value could be a hashed or encrypted form of the email address or another customer identifier as long as it is consistent and unique to each customer. e.g. example@email.com | Required |
p= | !!!PROMOTION!!! | The long ID of the promotion being sent to the recipient. This value is sent by email to the distributor is contained within the supplied HTML. e.g. ac7933005a4bd68ce2994435a9dd1338 | Required |
d= | !!!DATETIME!!! | Optional date and time (in UTC) for when the unique code expiry countdown should start. e.g. 2017-05-30 14:00:00 or 1496745719 (timestamp) If you have set up the promotion such that unique codes expire a certain period after the are generated and independently from the promotion end date then you can use this parameter to specify when the countdown to expiry should start. The default behaviour is for the countdown to start when the customer first opens the email, which is also when the code will be generated. As an example, you may want to issue codes that expire a certain amount of time after the email is sent rather than after the email is opened. You will need to pass the email send time as the value to this parameter. | Optional |
u= | !!!URL!!! | The URL of the destination page that you would like to send the customer through to. e.g. http://example.com | Optional |
Adding codes to other links
Unique codes issued to the customer in the email can be carried through to your website and then auto-filled in the code entry field in your checkout process. This is enabled by ensuring all links in your email that click through to your website are prefixed with the redirect link below. See the table of parameters for placeholder and parameter details above.
https://email-code.uniqodo.com/code-claim/click?e=!!!EMAIL!!!&d=!!!DATETIME!!!&p=!!!PROMOTION!!!&u=!!!URL!!!
Example HTML for creating a deep-link that carries the unique code through to the destination URL
<a href="https://email-code.uniqodo.com/code-claim/click?e=chrisgiddins@gmail.com&p=ac7933005a4bd68ce2994435a9dd1338&u=http://www.uniqlo.com/uk/">
Click Here to visit the site</a>
Styling the code image
By default the code image will generate a with black text colour, black border colour and white background colour. These colours can be edited by adding hexadecimal colour references to the image URL.
The parameters and values that can be added to the image src URL are explained in the table below.
Parameter | Description | Example Value |
tc= | The hexadecimal reference for the colour of the unique code text. | 000000 |
bc= | The hexadecimal reference for the colour of the border. | 000000 |
bgc= | The hexadecimal reference for the colour of the unique code image background. | ffffff |
Example
<a href="https://email-code.uniqodo.com/code-claim/click?e=email@example.com&p=82430a3b3708138c0bcd410dbdf7e6aa&u=http://uniqodo.com">
<img src="https://api.uniqodo.com/code-claim/email?e=email@example.com&p=82430a3b3708138c0bcd410dbdf7e6aa&tc=5abcae&bc=5abcae&bgc=ffffff">
</a>