Customer Engagement Personalization

Personalization Examples via Freemarker

Personalization is a critical component of customer engagement, and it can be achieved through the use of powerful tools like Freemarker. As a customer engagement platform, Herogi provides access to Freemarker for generating custom dynamic action parameters.

Freemarker is a powerful template language that allows the use of assignments, conditional blocks, string and arithmetic operations, formatting, macros, functions, and much more. With Herogi, you can create templates with dynamic parameters that change according to event and session data while actions are processed.

Let’s take a look at some examples of how Freemarker can be used for personalization with Herogi:

1. Assignments:

<#assign username="${event.name.value()}"+" "+"${event.surname.value()}">

For an event that has a name parameter like Jenn and a surname parameter like Brown, this template will generate the following:

Hello Jenn Brown, Welcome to Herogi

2. Conditions:

<div> Hello <#if ${event.gender.value()} == "male">Mr.<#else>Mrs.</#if> ${event.surname.value()}, <br><br> Welcome to Herogi </div>

If the gender parameter is male and the surname parameter is Brown, this template will generate the following:

Hello Mr. Brown, Welcome to Herogi

3. Arithmetic Operations:

<#assign averageAmount=(amount1+amount2)/2> <#assign profit=salePrice-cost> ${event.loginCount.value()+1}

4. Functions:

<#function concat name surname> <#return name+" "+surname> </#function>

If you call the concat function like this:

${concat("Jenn", "Brown")}

It will return:

Jenn Brown

5. Loops:

<#list names as name> ${name} </#list>

Assuming names contains the [‘Jenn’, ‘Jack’, ‘Smith’] sequence, the output of this template will be:

Jenn Jack Smith

By using Herogi, you can easily integrate these personalized templates into your email, SMS, push notifications, or API calls. This allows you to create targeted, personalized messages that will increase customer engagement and satisfaction.

In summary, Herogi provides powerful tools like Freemarker for creating personalized content that can be used across various customer engagement channels. By leveraging these tools, businesses can increase customer engagement and satisfaction, ultimately leading to increased revenue and growth.

Share this post

Discover More