web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Can we change Content block (Header/footer) dynamically based on contact's language

(0) ShareShare
ReportReport
Posted on by 216

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

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    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.

    pastedimage1596681989721v1.png

    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}}

    3515.JPG

    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

    pastedimage1596683284610v3.png

    preferred language of Alex is French

    pastedimage1596683241075v2.png

    Header of marketing email to Clofly will be German

    pastedimage1596683358242v4.png

    Header of marketing email to Alex will be French

    pastedimage1596683395763v5.png

    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

  • Fariha Asmat Profile Picture
    216 on at

    Thank you so much Clofly. I will definitely try this solution.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 101

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 79 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 58

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans