Send an email with promotions labeled with a specific tag
This use case describes the process of sending promotions through the email channel. The email template contains a predefined HTML block with promotions which retrieves a Synerise promotion you indicate in the configuration of this block.
The promotions can be easily adapted for different communication channels, but in this scenario, we will focus on email campaigns. Our target audience consists of active users who have made at least one purchase in the past year. The campaign will dynamically deliver the list of active promotions available for a specific user, presenting only offers with a specific tag. This approach is especially important when managing multiple active promotions from different areas but intending to send only those that are tagged with the home
label within your campaign.
With the power of dynamic HTML blocks, we can seamlessly integrate these promotions into the email templates, ensuring that each recipient receives relevant offers.
Prerequisites
- Create an email account.
- Import your product feed to catalog.
- Implement mobile pushes in your mobile application: iOS, Android.
- Implement a tracking code.
- Implement the transaction events using SDK or API.
Process
In this use case, you will go through the following steps:
- Create promotions with specific tag.
- Create a segmentation of customers who have made a transaction last year, this group will be the recipients of the email campaign.
- Create an email template.
- Create an email campaign.
Create promotions
In this part of the process, create a promotion (or more) which you will insert in the email template. You can create a promotion with the following scopes:
- For selected items - you can select items to which you want to apply a discount
- For entire basket - you can reduce the value of the whole shopping cart if its value matches the fixed price limit,
Regardless of the selected promotion scope, in the configuration of the promotion, in the Content section, find the Add tag field and add a
home
tag.
Create a segmentation
In this part of the process, we will create a group of customers who have made a transaction during the last year. This group will serve as the recipients of an email campaign. Itβs important to clarify that these customers will receive the email, rather than being the target audience for a promotion. Additionally, ensure that the conditions set for the Audience in the promotion do not conflict with those of the Audience for the email recipients, to avoid any discrepancies between the two groups.
- Go to Analytics > Segmentations > New segmentation.
- Enter the name of the segmentation.
- Click Add condition.
- From the dropdown list, select the
product.buy
event. - From the Choose operator dropdown, choose Boolean, and then select Is true.
- Using the date picker in the lower-right corner, set the time range to Relative time range > Last 365 days. Confirm by clicking Apply.
- Save the segmentation.
Create an email template
To distribute the promotions, you need to prepare an email template that includes the promotion created in the previous step of the process. This step involves incorporating Jinjava code into the email template to fetch the details of the promotion labeled with the home
tag for which an email recipient is eligible. The instructions for this step include the necessary code.
-
Go to Communication > Emails > Templates > Drag&drop builder.
-
From the Content section, click HTML BLOCKS and add pull it to the chosen place in your template.
-
Click the Configure button.
-
Choose the Predefined blocks folder where you will find the Promotions block.
-
You must edit the template of the predefined block. It already contains a universal reference to a promotion, but we need to narrow down the promotion scope to those which are labeled with the home tag. The following changes must be added to the code of the block in the HTML section: - to
{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline"] %}
, add, "tags"
- replace{%- if count < noOfItems -%}
with{%- if count < noOfItems && i.tags|selectattr("name", "equalto", "home")|length > 0 -%}
and if you’re using other tag than home, replace"home"
with the name of your tag
Below, you can compare the code before and after changes:{% set fieldsVar = ["code", "params", "name", "status", "images", "params", "description", "headline", "tags"] %} {% promotions fields=fieldsVar %} {% set count = 0 %} {%- for i in promotions_result -%} {%- if count < noOfItems && i.tags|selectattr("name", "equalto", "home")|length > 0 -%}
- When you finish customizing the block, to use proceed to saving changes in templates, click Next.
If you want to save the block for future use, click Save as, in Block name, enter the name of the block and in Block folder, select the folder in which your block will be saved. - Save the template by clicking Save as.
- In Template name, enter the name of the template.
- In Template directory, select the folder in which the template will be saved.
- When you finish customizing the block, to use proceed to saving changes in templates, click Next.
Create an email campaign
In this part of the process, you will create an email campaign with the list of the promotions available for the recipient.
-
Go to Communication > Email campaign > Create new.
-
In the Audience section, choose the segmentation created in the previous step.
Note: Please remember that the predefined HTML block with promotions works for a given customer only if they are in the audience of at least one promotion. If none of the selected promotions are available for the user, the email will not be sent. -
To confirm you choice, click Apply.
-
Configure the Content section.
- In *From email address, select the email account from which you want to send your message.
- In From name, enter the sender name that is displayed in the mailbox.
- In the Subject field, enter your message subject.
- Click Create message and choose an email template created in the previous step.
- Apply changes.
-
In the Schedule section, specify the time when you want to send your communication.
-
You can optionally define UTM & URL parameters.
-
Confirm by clicking Apply.
Check the use case set up on the Synerise Demo workspace
On our Demo account, you can check:
If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.