I’m trying to use conditional statements in a plain text email to display a different sentence depending on the contents of a profile property.
Background: we have a product recommendation quiz, and the results populate in a customer’s profile on klaviyo. The property contains the info on three key areas, but I only need to reference part of it for this - so it’s ‘contains’ logic vs ‘is exactly’
In a drag+drop email I’ve successfully used the following show/hide logic to achieve a similar result when sending them the product recommendation:
I’m now trying to pull the same logic through on a plain text email with if/else statements. I can get this to save, but it gives and ‘invalid template tags or filters’ error when I try to preview it:
Hi {{ first_name }},
This is an email just for you. We hope you like it.
{% if 'Likely Starter or Weekend' in person|lookup:"TAGS-gWH3zR" %}
starter week
{% elif 'Likely Weekend or Tiny' in person|lookup:"TAGS-gWH3zR" %}
weektiny
{% elif 'Like Tiny House or Bach' in person|lookup:"TAGS-gWH3zR" %}
tinybach
{% elif 'Likely Bach or Freedom' in person|lookup:"TAGS-gWH3zR" %}
bachfree
{% elif 'Likely Freedom or Lifestyle' in person|lookup:"TAGS-gWH3zR" %}
freelife
{% else %}
Have you heard about our VIP program? Join today on our website to start earning rewards.
{% endif %}
Looking at some help articles I thought that maybe changing the “ to ‘ on the TAGS bit, but that gives this error: “There is an error in your email content. The "lookup" filter requires 2 arguments, but 1 was given”
Each of those contents also exists as its own property stored as true/false - am I better off setting it up using these tags instead? (they’re all true because this is my profile for testing)
If anyone has some insight it would be greatly appreciated!