Solved

Dynamic content in Flow based on time of the day / day of the week

  • 25 March 2022
  • 1 reply
  • 100 views

Badge +2

Hi 

I’d like to show in our Abandoned Basket email our Free Next Day delivery message but only if customer receive the email prior to our cut off (3pm). 

Is there a way to do this? 

Thanks

Leo 

icon

Best answer by alex.hong 25 March 2022, 23:15

View original

1 reply

Userlevel 7
Badge +58

Hi there @Leo Pure Electric,

Klaviyo Templates use Django coding, so you can use Django Template Tags and Syntax to achieve your goals. 
 
Essentially, you will need to set up very specific syntax such as this:

{% now "m" as month %}{% if month == "01" %}THIS CONTENT SHOWS IF MONTH IS "01" {% elif month == "01" %}THIS CONTENT SHOWS IF MONTH IS "02"{% elif month == "03" %}THIS CONTENT SHOWS IF MONTH IS "03"{% else %}THIS CONENT SHOWS FOR ALL OTHER MONTHS{% endif %}

This syntax can be used to specify content based on the time of year, by evaluating the numerical month value of "now". 
 
For time of day, you can use something like this:

{% now "G" as hour %}{% if hour < "12" %}THIS CONTENT SHOWS IF IT IS MORNING {% else %}THIS CONENT SHOWS IF IT IS AFTERNOON{% endif %}

This syntax can be used to specify content based on the time of day, by evaluating the numerical hour value of "now". 
 
Note that "now" is considered the timestamp the email was sent, at which point the HTML is rendered within Email Inboxes. So "now" will not adjust if a recipient receives an email on March 31st but opens it on April 1st - in this case the month will be rendered according to send time (March not April). 

You could also natively trigger a flow based on whether someone opened an email (with the Opened Email event). Anything besides that would be out of possibility.
 
I hope this helps you to achieve your goals. 

Alex

Reply