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