Addressing your customers appropriately is an excellent method to personalize your content. By leveraging your contact data and ESL, you can create diverse and tailored salutations to enhance engagement and connection with your audience.
Salutation holds significant importance in the German language, where it is commonly defined based on gender. To help you implement automatic and gender-appropriate greetings for your customers, we have prepared some code examples showcasing how you can utilize ESL effectively.
Conditional salutations based on gender and availability of first name
The Emarsys platform performs a check to determine if the contact’s first name is available. If a first name is found, it generates a salutation in German using Lieber [first name] for men and Liebe [first name] for women. If the gender is not specified in the database, a non-gender-specific salutation Liebe(r) Kunde/Kundin (Dear customer) is displayed.
In the absence of a first name, the salutation Hello, is used.
{% if contact.1 != '' %}
{% if contact.5 == 1 %}Lieber {{ contact.1 }}{% elseif contact.5 == 2 %}Liebe {{ contact.1 }}{% else %} Liebe(r) Kunde/Kundin {% endif %}
{% else %}Hallo, {% endif %}
The Emarsys platform validates the salutation assigned to the contact, determining if it is Mr. or Mrs. If the salutation is Mr., the salutation Lieber [First Name] [Last Name] is used. If the salutation is Mrs., the salutation Liebe [First Name] [Last Name] is applied.
In case the salutation is not specified, the default salutation Liebe(r) Kunde/Kundin (Dear customer) is used.
{% if contact.46 == 1 %}Lieber Herr {{ contact.1 }}{{ contact.2 }} {% elseif contact.46 == 2 %}Liebe Frau {{ contact.1 }}{{ contact.2 }} {% else %} Liebe(r) Kunde/Kundin, {% endif %}
Extended salutations (adding Family name, combined contacts)
It is possible to revalidate custom salutation options and dynamically select from various values to determine the appropriate greeting:
{% if contact.12661==1 %} Lieber Herr {% if contact.8963!="" %} {{contact.8963}} {% endif %} {% if contact.8937!="" %} {{contact.8937}} {% endif %} {{contact.2}}, {% elseif contact.12661==2 %} Liebe Frau {% if contact.8963!="" %} {{contact.8963}} {% endif %} {% if contact.8937!="" %} {{contact.8937}} {% endif %} {{contact.2}}, {% elseif contact.12661==3 %} Liebe Leserin, lieber Leser, {% elseif contact.12661==4 %} Liebe Leserin, lieber Leser, {% elseif contact.12661==5 %} Liebe Familie {% if contact.8937!="" %} {{contact.8937}} {% endif %} {{contact.2}}, {% elseif contact.12661==6 %} Liebe Frau und Herr {% if contact.8937!="" %} {{contact.8937}} {% endif %} {{contact.2}}, {% else %} Liebe Leserin, lieber Leser, {% endif %}
Teaser Logic and images
The Teaser Logic feature responds to the display of a teaser image and dynamically adjusts the positioning of the title and subtitle within a two-column block. The content and teaser definitions, which are controlled by the RSS feed, are included in the .custom_field_3
field:
Title = webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_1
SubTitle = webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_4
Here is an example of how the options can be displayed:
First, the lengths of the title and subtitle are calculated, and their numerical values are stored in variables (length_title
, length_subtitle
).
The first condition (#1) is evaluated:
- On the one hand, it checks if a teaser image (approximately 9 characters long) needs to be displayed. This is determined by the value of
field 3
from the feed, which should be set toTrue
in this case. - On the other hand, it verifies if the character length of the subtitle is within the maximum available remaining width of approximately 26 characters.
If both conditions are met, the teaser image is displayed with the subtitle beside it.
The second condition (#2) is then examined:
{% set length_titel = webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_1|length %}
{% set length_subtitel = webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_4|length %}
{% if webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_3=="true" and length_subtitel < 26 %}
<table cellpadding="0" cellspacing="0">
<tr>
<e-optional name="Column 1 - Dachzeile-Teaser">
<th class="fl vam">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="left"><img e-editable="imageB_1" src="http://link.newsletter.welt.de/custloads/872193279/vce/weltpluslogo4x.png" width="53" border="0" class="rw60" style="display:block;"></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
</th>
<th width="16" class="fl rh5"></th>
</e-optional>
<e-optional name="Column 1 - Subheadline 1">
<th height="25" class="fl vat">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="{variables.tas}" class="lh14p la-subheadline dptb3lr0 vam"><font e-editable="textB_1" class="ff fs11 fc-subheadline upc xsmall">{{webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_4}}</font></td>
</tr>
</table>
</th>
</e-optional>
</tr>
</table>
{% elseif webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_3=="true" and length_subtitel >= 26 %}
<table cellpadding="0" cellspacing="0">
<tr>
<e-optional name="Column 1 - Dachzeile-Teaser">
<th class="fl vam">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="left"><img e-editable="imageB_1" src="http://link.newsletter.welt.de/custloads/872193279/vce/weltpluslogo4x.png" width="53" border="0" class="rw60" style="display:block;"></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
</th>
<th width="16" class="fl rh5"></th>
</e-optional>
</tr>
<e-optional name="Column 1 - Subheadline 2">
<tr>
<td colspan="2" align="{variables.tas}" class="lh14p la-subheadline dptb3lr0 vam"><font e-editable="textB_1" class="ff fs11 fc-subheadline upc xsmall">{{webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_4}}</font></td>
</tr>
</e-optional>
</table>
{% elseif webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_3=="false" and length_titel + length_subtitel >= 35 %}
<table cellpadding="0" cellspacing="0">
<tr>
<e-optional name="Column 1 - Dachzeile-Teaser">
<th class="fl vam">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="lh14p la-subheadline dpt5b3lr0 vam"><font e-editable="textA_1" class="ff fs11 fwb fc-subheadline upc xsmall">{{webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_1|required}}</font></td>
</tr>
<tr>
<td bgcolor="#F18825" height="1"></td>
</tr>
</table>
</th>
<th width="16" class="fl rh5"></th>
</e-optional>
</tr>
<e-optional name="Column 1 - Subheadline 2">
<tr>
<td colspan="2" align="{variables.tas}" class="lh14p la-subheadline dptb3lr0 vam"><font e-editable="textB_1" class="ff fs11 fc-subheadline upc xsmall">{{webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_4}}</font></td>
</tr>
</e-optional>
</table>
{% elseif webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_3=="false" and length_titel + length_subtitel < 35 %}
<table cellpadding="0" cellspacing="0">
<tr>
<e-optional name="Column 1 - Dachzeile-Teaser">
<th class="fl vam">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="lh14p la-subheadline dpt5b3lr0 vam"><font e-editable="textA_1" class="ff fs11 fwb fc-subheadline upc xsmall">{{webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_1|required}}</font></td>
</tr>
<tr>
<td bgcolor="#F18825" height="1"></td>
</tr>
</table>
</td>
</tr>
</table>
</th>
<th width="16" class="fl rh5"></th>
</e-optional>
<e-optional name="Column 1 - Subheadline 1">
<th height="25" class="fl vat">
<table cellpadding="0" cellspacing="0">
<tr>
<td align="{variables.tas}" class="lh14p la-subheadline dptb3lr0 vam"><font e-editable="textB_1" class="ff fs11 fc-subheadline upc xsmall">{{webhook.rss_to_content('4a894ecbe3215961')[5].custom_field_4}}</font></td>
</tr>
</table>
</th>
</e-optional>
</tr>
</table>
{% endif %}