Skip to main content

Hi there, we are looking to personalize an email by specifically referencing the user's state of residence. However, our user records store state information as abbreviations (ex: CA instead of California) instead of the full state name.



I'm looking to use Handlebar logic to say something like "if state = AZ, show 'Arizona'" etc. for each state.



Has anyone successfully done this?

Hey Gianna,

Thanks for reaching out.

This would be possible, but you'll have to write the handlebars out manually for each state. The good news is that after writing this logic out once. You can save it as a snippet that can be used going further!

An example of the logic given the state is a string would be



{{#ifContatinsStr state AZ}} Arizona {{/ifContainsStr}} {{#ifContatinsStr state NJ}} New Jersey {{/ifContainsStr}}



If you have any questions or run into any trouble setting this up! I would reach out to our lovely support team!

Thank you!

Omar


Reply