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.
Selecting the expression on the list of 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
In the Synerise Demo workspace, you can check the configuration of:
- the expression
- the email template
If you’re our partner or client, you already have automatic access to the Synerise Demo workspace (1590), where you can explore all the configured elements of this use case and copy them to your workspace.
If you’re not a partner or client yet, we encourage you to fill out the contact form to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.