Gratis demo

Unlocking the Power of Personalization with SAP Emarsys Scripting Language (ESL)

Teun van den Elzen, 02 augustus 2023

In today’s fast-paced digital world, businesses strive to deliver personalized experiences to their customers. The SAP Emarsys platform, a leading marketing automation solution, empowers marketers to create 1:1 personalized campaigns that resonate with their audience. At the heart of this customization lies the Emarsys Scripting Language (ESL), a user-friendly and powerful scripting language that takes personalization to new heights.

The Building Blocks

ESL’s personalization capabilities are driven by “Personalization Tokens.” These placeholders are used to populate email content with personalized information for each contact. Tokens are reusable across campaigns and can be easily added to templates via a simple drag-and-drop process.

By inserting tokens into email templates, marketers can replace these placeholders with the actual data for each contact. For example, using a First Name Token would dynamically display each contact’s first name in the email they receive. If First name is not available we could call this person for instance ”Friend”.

{{contact.1|default('Friend') }}

A Powerful Tool for Personalization

ESL is a scripting language designed to enhance personalization in marketing campaigns. Unlike standard personalization options, which rely on internal contact database fields, ESL allows marketers to dynamically tailor content based on various external factors. This includes business-specific data, product information from relational databases, and additional customer data not stored within the platform.

The language is specifically designed for marketers, making it user-friendly and easy to learn for those with a working knowledge of HTML coding. It enables marketers to break free from technical dependencies and build personalized rules, providing customers with a consistent and relevant experience across all channels.

Tailoring Messages for Different Audiences using conditional text

One of the most powerful features of ESL is the ability to create conditional text. Conditional text allows marketers to display different content to specific audiences based on predefined conditions. This segmentation is defined by conditions related to contact data, such as gender, location, or preferences.

Using IF statements, marketers can specify different content for each condition. For instance in the example below where we want to have a personalized Happy Birthday message for contacts that have their birthday today:

{% if contact.4|localized_date('en','Mdd') == 'now'|localized_date('en','Mdd') %}
Happy birthday !
{% endif %}

Data-Driven Recommendations with predict tokens

ESL’s Predict Tokens take personalization to the next level with data-driven recommendations. Marketers can leverage predictive analytics to generate personalized product recommendations based on each contact’s preferences, behaviors, and previous interactions. Using Predict Tokens, marketers can display recommended products that are specifically suited to each contact’s interests and buying habits. This level of personalization significantly enhances customer engagement and boosts conversion rates.

Personalized product lines can be embedded in the communication with your customer.

{{ predict.recommend('hu', 'PS_PERSONAL')[0].title }} 

The script above will result in:

predict 1
Example of the ESL predict Script


Example of the ESL in the message
Example of the ESL lines in the message

Expanding Personalization Horizons using External Data Tokens and Relational Data Tokens

ESL enables marketers to tap into external data sources to further enrich personalization. External Data Tokens allow access to data from external events, while Relational Data Tokens facilitate personalized content from relational databases. This data can be used to customize content based on specific customer actions or behaviors.

For instance, a travel company can utilize external data to offer personalized deals and recommendations based on a customer’s past travel history. With ESL, the possibilities for personalization are virtually limitless.


In the dynamic world of marketing, personalization is no longer an option; it’s a necessity. Customers expect brands to understand their needs and preferences and deliver tailored experiences consistently across all channels. SAP Emarsys Scripting Language (ESL) empowers marketers to fulfill these expectations and go beyond, creating personalized campaigns.

ESL’s user-friendly nature, combined with its robust personalization capabilities, makes it a valuable tool for any marketer seeking to drive engagement, loyalty, and revenue growth. By leveraging ESL’s power, businesses can build trusted relationships with their customers, ultimately standing out in a competitive market and achieving marketing success.

Would you like to enhance your personalization in SAP Emarsys with Emarsys Scripting Language? Reach out to one of our experts or get yourself started with the all new ESL knowledge base!

Teun van den Elzen

Read all my blogs

Receive our weekly blog by email?
Subscribe here: