Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

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

Posted on by 212

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

  • Fariha Asmat Profile Picture
    Fariha Asmat 212 on at
    RE: Can we change Content block (Header/footer) dynamically based on contact's language

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

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Can we change Content block (Header/footer) dynamically based on contact's language

    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

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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans