Where can I add ESL snippets to email campaigns?
You can add Emarsys Scripting Language (ESL) snippets in the Visual Content Editor (VCE) when creating a block-based email campaign in the Content Creation step.
How can I insert ESL snippets into email campaigns?
Click anywhere in the text to open the toolbar.
- Click the ‹ › icon to open the editor where you can add the ESL snippet.
Example of an ESL snippet containing alternative text for the first name:
Hello, {{ contact.1 |default("Stranger") }}!
- You can add the ESL snippet and then save by clicking OK.
Similarly to other personalization options, the snippet will be displayed within the text.
Please note:
- You cannot use the old personalization variable $ and/or % together with the new variable {{ }} in ESL expressions because your email might be canceled. For more information, please contact Emarsys Support.
- Placeholders, variables, and scripts used in other platforms (for example, SFMC, Shopify, Magento, etc.) will break ESL and your email will be canceled. To prevent such issues, you must remove ALL of these instances from your campaigns.
By using the snippets, you have the option to freely format your content, without breaking the end result in your email.
Using ESL snippet and emoji in the subject line and email content
In the email subject line and in the email content you can use emoji icons and ESL code to personalize and further customize the email.Note: ESL tokens are not supported in the email subject line only in the email content, but you can write an ESL code in the subject line field without using tokens.
Using emoji as fallback text and formatting the email
This ESL code example displays “We will miss you” and the first name in a capitalized format and displays a sad emoji 🙁 when the First name field for the contact is empty:
We will miss you {% if contact.1 == "" %} 🙁 {% else %} {{contact.1| capitalize}} {% endif %}
You can add the ESL snippet and then save by clicking OK
Checking how the ESL snippet will look for my users
Send a testmail to check in your Gmail inbox the actual result of the ESL codes with the emojis in the email subject line and in the email content:
Size and location limitation of using emojis with ESL snippets
Emoji characters with 4-byte or bigger size cannot be rendered properly when used within an ESL code.
Location limitation of emojis
- To ensure your emoji character is displayed correctly, use them outside of the bracketed statements, like in the example above.
- Avoid using emoji within the statements as it cuts the rest of the content.
Example for an incorrect ESL code with emoji (the emoji is at wrong place):Hello {{ contact.1 | default("🙁") | capitalize }}
How do I know my ESL snippet is valid?
When adding an ESL snippet to your content, the ESL script is validated on a campaign level. When adding the snippet, the editor performs an automatic validation check to determine the validity of your code. Even if the script is not valid, you still have the option to save the token. It is crucial to carefully review the code before proceeding.
Checking how the ESL snippet will look for my users
Contact preview
You can check how the ESL snippet will look for your users in the Contact Preview.
Click the Contact Preview icon to open the Contact Preview pane where you can select your contact.
Search field - The search field on the Contact Preview pane is dynamic, and previously used contacts are stored in the list. In this way, you can create test contacts that correspond to the contacts you are targeting with your campaign and make sure that the email looks great for all of them.
Contact Preview is unable to display external data, such as event-type tokens, since no data is sent during a preview. Similarly, certain product catalog tokens function in the same way, as they require data from external sources that are only available upon launch.
Sending testmails
You can check your ESL snippet for the user via sending a testmail. To send a testmail, open the Content Creation page and click Testmail.
In the pop-up, set the Subject line and the Recipient source. This can be either a Contact list, a Segment or you can enter email addresses manually.
Click Send to launch the testmail.
Testmail is unable to display external data, such as event-type tokens, since no data is sent during testing. Similarly, certain product catalog tokens function in the same way, as they require data from external sources that are only available upon launch.
For ESL examples, see the examples section.