Solved

How do I use date tags in If statements?

  • 2 December 2021
  • 1 reply
  • 158 views

Badge +2

I’m trying to build a flow for a loyalty program that will use if statements to show certain content in the emails.  I’ve gotten if statements to work before but I’m having trouble with one I’m trying to include that will show different content based on the month the email is sending out.  I assumed it would be possible to use a date tag in an if statement but I haven’t been able to get the messaging to show.  Below is the if statement I’ve written:

{% if current_month_name = January %}

{% elif current_month_name = February %}

{% elif current_month_name = March %}

{% elif current_month_name = April %}

{% elif current_month_name = May %}

{% elif current_month_name = June %}

{% elif current_month_name = July %}

{% elif current_month_name = August %}

{% elif current_month_name = September %}

{% elif current_month_name = October %}

{% elif current_month_name = November %}

{% elif current_month_name = December %}

{% endif %}

 

Is there something else I should be using to pull in the month within the statement?

icon

Best answer by alex.hong 2 December 2021, 23:52

View original

1 reply

Userlevel 7
Badge +58

Hey there @Sarah F.,

Welcome to the Community! 

So one way you could achieve this is to clone a flow and set new triggers for each month! That way you could have 12 variations of a flow but with a different trigger and email that gets sent out for each of them based on the month. 

Creating 12 templates and 12 duplicate flows to use and manage for each month would probably be easier than trying to code an if statement for different templates. For more on the template editor and email design, see below:
Getting Started with Email Design
Overview of the Email Template Editor
How to Create, Edit, Delete, and Manage Templates

However, I’d love to hear what your thoughts are and other Community member strategies to this question as well!

Have a good one!
Alex

Reply