Skip to main content

Hi Iterable community!

 

We are looking to personalize an email based on whether or not you're in one of 22 states that are eligible for this message. I'm struggling to figure out the handlebar logic that would check if you're in one of these 22 states and populate that eligible message. The fields we're using for this are:

user field = locations
content = state initials (CA, CO, IA, etc.)
type = string

Essentially, I'm looking to say:
if locations=CA or locations=CO or locations=IA insert message here if else N/A.

 

I've tried #or, #ifContainsStr, #if, etc. and so far no luck.

Has anyone done something similar and can help me build out this logic?

From @Alejandra Perez 

Hi Lo! Since a couple of the handlebar helpers you have used are not working, I recommend having an ASC (or you, if you are an authorized support contact) send an email to Iterable Support. This will allow them to review the Handlebar logic in your specific template.

Best,

Alejandra 😊


From @Lauren Cory 

Or try ChatGPT 😉 I was recently in a meeting with other Iterable marketers that say they used GPT to verify and test dynamic handlebar logic. I haven't tried it myself, but plan to.


From @Steven Park 

if you use html to build out the contents you can use dynamic content.

i make a template of the email with the data feed, export the html and then make a snippet. within the snippet html i can add dynamic content.

within the dynamic contant, you can say if user location is this… set text to this.



From @John Fitzsimmons 

Hi - Are you able to use the regex helper like this?

{{#ifMatchesRegexStr location "CO|CA|IA"}}
Yes Matched State
{{/ifMatchesRegexStr}}


From @Myron Pan 

Thank you, @John Fitzsimmons . That's what I would usually recommend for this as well.
 



**This response has been manually added from our former community platform to ensure the full conversation is captured. Please note that the date of this post will appear significantly later than the original.


Reply