Update the value of discounts in communication
If you offer your customers a discount with a fixed value in response to their actions, you can use an expression as a variable in the templates of your messages (email, SMS, mobile push, web push) and other types of communication (dynamic content on websites) to display the discount value.
The main advantage of this solution is quick modification of the value of discount - when you modify the expression, its result is automatically updated in all templates the expression is used.
Prerequisites
Implement tracking code on your website.
Process
- Create an expression.
- Use the expression insert in templates.
- Modify the expression.
Create an expression
In this part of the process, you create an expression with a discount value, which will be used as a variable in the template of the message further in the process.
- Go to Analytics > Expressions > New expression.
- Enter the name of the expression.
- Leave the Expression for option at default (Attribute).
- Build the formula of the expression.
- Click Select.
- From the dropdown list, select Constant.
- Click the field that appeared on the dashboard.
- Enter the value of discount.
- Click Save.
Use the expression insert in templates
In this part of the process, you use the expression as a variable in the message template.
- Go to Communication and select the type of message.
- Go to the code editor.
- On the upper right side of the screen, click + Inserts.
- From the dropdown list, select Expressions.
- Find the expression you created in the first part of the process.
- Click the name of the expression.
- Copy the Jinjava code of the expression.
- Paste it in the template.
- Style the template according to your preferences.
Modify the expression
If you need to change the value of the discount, edit the expression you created in the beginning of the process. As a result, the expression will return the new value in all templates in which the expression is used as a variable.
To edit the expression:
- Go to Analytics > Expressions.
- Find the expression on the list.
- Click the expression.
- Make the changes to the formula of the expression.
- Click Publish.
Check the use case set up on the Synerise Demo workspace
Check the expression settings directly in Synerise Demo workspace.
Check also the example of email template in which you can see the expression added as an insert.
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.