- 1 Minute to read
- Print
- DarkLight
Example: Local Store Promotion
- 1 Minute to read
- Print
- DarkLight
Description
This example shows an InsertIF expression to include dynamic content about local stores in an email using related data.
A company wants to include information about local stores opening in their regular newsletter. A promotion banner should be displayed only to customers who live near the store and only within 2 weeks before and 2 weeks after the newsletter run date.
See the Use Case video: Integrate Local Store Promotions in Your Regular Campaigns.
Prerequisites
The related data parameters must exist in your Engage system if you want to use the code from this page. Please note that you must replace the parameters in the code with the ones that your system is using.
Related Data Set
The related data set is called "stores" and uses the Linked User Attribute "user.CustomAttribute.city". It has two columns: OpeningDate, which represents the opening date of the local stores, and Image Url, which represents the URL of the image in the Content Store.
Example of the related data values in the related data set:
Parameters
Here is a list of all parameters used in the example expression.
Time Range
This parameter uses the store opening date from the related data set. It checks if the store opening is in the time range from two weeks before to two weeks after the newsletter run date. Only if these conditions are met will the banner be displayed in the email.
|
Image
This parameter looks at the Image Url value to select the image that should be displayed as a banner email.
|
Expression
Below is the full InsertIf expression.
|