Skip to main content
Contributor I
August 20, 2024
Solved

Using If Statement to insert message based on recipient's email domain

  • August 20, 2024
  • 1 reply
  • 85 views

I am trying to display a custom message to recipients with a gmail address:

{% if 'gmail' in email %}
As you are a Gmail user, be sure to click "View entire message" at the bottom so you can read the whole email
{% endif %}

I added a debug line that stated:

Debug: Your email is {{ email|default:'' }}

 

But when I open up  the test message in gmail, the email it prints out is my klaviyo login email (which is not gmail).  

So am I doing this wrong, or is this happening because I am doing it using the Test email functionality?

    This topic has been closed for replies.
    Best answer by bluesnapper

    Welcome to the community @nodiseos 

    That works OK for me in preview and from a test sent to a gmail address!

    You could also use display logic for a text block: "gmail" in person.email

    Hope that helps

    Regards

    Andy

    1 reply

    bluesnapper
    Partner
    Champion & Partner
    August 21, 2024

    Welcome to the community @nodiseos 

    That works OK for me in preview and from a test sent to a gmail address!

    You could also use display logic for a text block: "gmail" in person.email

    Hope that helps

    Regards

    Andy

    https://bluesnapper.com - Klaviyo Champion '24 & Partner