In iPresso, you have the ability to personalize message content based on a contact's activity. For example, we might want to display the last two products viewed by the user in an email, using the activity of visiting a product page. To achieve this, you'll need the API keys of the specific activity and its parameters. You can find these keys in the following path:
System -> Dictionaries -> Contacts -> Activities and actions -> Definitions.
To personalize activities when creating messages (HTML code), we use the following expression:
data-repeat="{contactActivities_[APIkey]_[number]}" data-repeat-item="order
The fragment “contactActivities” means that we will be working with the contact's activity. Replace “APIkey” with the API key of the selected activity, and replace “[number]” with the number of recent parameters of this activity that you want to display. The word “order” is an example variable that will be used later when inserting activity parameters.
In the example message, we want to show two contact activities (Product Purchase), which has the API key “__product_purchase”. We will use three of its parameters for this:
- Page URL (__image_url)
- Product page URL (__url)
- Product name (__product_name)
To personalize the email with these activities, we insert the following example expression into the HTML code:
<ul data-repeat="{contactActivities_[__product_purchase]_[2]}" data-repeat-item="order">
<li><b>Produkt:</b><a href="{__order.__url__}"><img src={__order.__image_url__}
alt={__order.__product_name__} style="width:400px;"></a>
<li><b>Strona produktu:</b>{__order.__url__}
</li>
</ul>
When inserting activity parameters, you must use the variable (in this case, the word “order”) along with the API keys for each parameter. The example message was created in such a way that the email shows images of the last 2 purchased products. When clicked, the user will be redirected to the product page. Below the images, there are also links to the product pages, and in case the images fail to load, the product name will appear in their place, with a link to the product page.
In the above screen, there is no preview of the images because the system does not yet know which contact's activities to consider. To see the content of the email, you need to go to the "Preview" section and select a test contact for which the activity information will be retrieved.
Of course, you can configure each email campaign in your own way, using different activities, parameters, styles, etc.
Conclusions
In iPresso, you have the capability to personalize email content based on contact activities, allowing for a more tailored communication experience. By utilizing specific API keys and parameters, such as those related to product purchases, you can dynamically display relevant information, like product images, names, and links to their pages. While the system may not initially show image previews due to the lack of specified contact activities, navigating to the "Preview" section and selecting a test contact allows you to visualize the email content. Furthermore, each email campaign can be customized according to your preferences by incorporating various activities, parameters, and styles, ensuring a unique approach to engaging with your audience.
Comments
0 comments
Please sign in to leave a comment.