Skip to main content
Solved

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

  • August 20, 2024
  • 1 reply
  • 31 views

Forum|alt.badge.img

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?

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

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

bluesnapper
Partner
Forum|alt.badge.img+45
  • Champion & Partner
  • 734 replies
  • Answer
  • 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