HI
I have a requirement to change the content block (Header/footer) based on contact's language or country. Actually i have 2 header footer one is in English and the other one is in Germany. I want to change the header or footer of an email based on contact's country dynamically. Is it possible ?
Thankyou
Thank you so much Clofly. I will definitely try this solution.
Hi Fariha,
Yes, we can display content blocks with different language with conditional statements, Protected field of content blocks should be set to No.
For example, I created a custom field "Preferred language"(Option set field) to Contact entity.
1. Add content blocks with different language as header to marketing email.
In my demo, I added English, French and German blocks.
2. In HTML editor, search for keyword " data-editorblocktype="Content" " to locate content block element.
We nest different content blocks with conditional statement.
e.g:
{{# if (eq contact.new_preferredlanguage 100000001)}}
French
{{else if (eq contact.new_preferredlanguage 100000002)}}
German
{{else}}
English
{{/if}}
Dynamics 365 for Marketing
![]()
Mein Name ist Clofly, ich spiele gerne Melodica.
Dynamics 365 for Marketing
![]()
Je m'appelle Clofly, j'aime jouer du mélodica.
Dynamics 365 for Marketing
![]()
My name is Clofly, I like playing the melodica.
3. Test
There are two contacts:
preferred language of Clofly is German
preferred language of Alex is French
Header of marketing email to Clofly will be German
Header of marketing email to Alex will be French
In addition, please note the following points:
1. If option set field value is null(no option is selected), then all nested blocks will be ignored,
this behavior is limitation of HandlebarsJS, the template language couldn't handle null situation by default.
So we have to set a preferred language for all contacts if the based field is option set type.
2. <!-- --> comment is optional for conditional statements, but I suggest you could add it to make HTML content be more readable.
Regards,
Clofly
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156