Skip to main content
Contributor I
August 24, 2022
Solved

Personalized Email Salution

  • August 24, 2022
  • 6 replies
  • 549 views

Hi all. 

I currently need some help tp personalize my emails. Who can help me?

I have a wellcome message in which I want to personalize the salution in case, I have the data/properties. I tried the following, but it dosen’t work: Can someone please tell me, what’s wrong?

{% if person|lookup:'Anrede' == 'Frau' %} Liebe {{ first_name }} {% elif %} {% person|lookup:'Anrede' == 'Mann' %} Lieber {{ first_name }} {% else %} Liebe Freunde von THEO & EMMA {% endif %}

Thanks in advance!! 

    This topic has been closed for replies.
    Best answer by alex.hong

    Hi @bitmap,
    I believe this text is appearing because you might be previewing the template within the template builder and not from within a campaign or flow. This code will not show up when placed in a campaign or a flow. When you are previewing a template from the template library - that is expected behavior. We have encoded our preview text within every template created. 

    If you pull your template into a Campaign or Flow and preview from there, that code will not appear. Can you confirm if this is true or not?

     

    Thank you,

    Alex

    6 replies

    alex.hong
    Klaviyo Alum
    August 24, 2022

    Hi @bitmap,

    Welcome to the Community.

    I believe you are looking to add dynamic syntax to your emails. I think that this help article, another help article, and this community post would be good places to start:

     

    Hope that helped,

    Alex

    bitmapAuthor
    Contributor I
    August 25, 2022

    Thank you Alex,

    But I want an „extra“ dynamic syntax for the „Hey“ in your example. In Germen I want to use „Liebe“ {{ first_name }} if its a woman and „Lieber“ {{ first_name }}if its a Man. And as an default, I want to use a generic salution in case I haven‘t got the name: „Liebe Freunde von …“

    Can you help me how to do this? Thanks.

    bitmapAuthor
    Contributor I
    August 25, 2022

    Hi @alex.hong 

    Tried this if/else but when I sent a test mail, I only get the default text: Any Idea? Thanks

     

    {% if person|lookup:'Frau' %} Liebe {{ first_name }},

    {% elif person|lookup:'Mann' %} Lieber {{ first_name }},

    {% else %} Liebe Freundin, lieber Freund von THEO & EMMA,

    {% endif %}

    alex.hong
    Klaviyo Alum
    August 25, 2022

    Hi @bitmap,

    I think that would depend on if you have a property on user’s accounts that can be used to switch the type of text block that is shown. If you are not seeing the syntax working, I would make sure you are using a test profile that has a first name or something to look up.

     

    Thanks,

    Alex

    bitmapAuthor
    Contributor I
    August 26, 2022

    Hi @alex.hong 

    thank you. Yes, I have a testprofils with the properties mentioned in the if/else code.

    Anrede: Frau / Mann
    Firstname: xxx

    But … In preview mode, I only get the default, i mean the “else” text. Is there something wrong with the code? 

    Thanks!

    alex.hong
    alex.hongAnswer
    Klaviyo Alum
    August 26, 2022

    Hi @bitmap,
    I believe this text is appearing because you might be previewing the template within the template builder and not from within a campaign or flow. This code will not show up when placed in a campaign or a flow. When you are previewing a template from the template library - that is expected behavior. We have encoded our preview text within every template created. 

    If you pull your template into a Campaign or Flow and preview from there, that code will not appear. Can you confirm if this is true or not?

     

    Thank you,

    Alex