Dynamic Content Based on Current Date

  • 30 August 2022
  • 3 replies

Userlevel 4
Badge +17

Is it possible to show/hide blocks of content based on the CURRENT DATE

(not a date stored on a customer profile or in metric/event data)


Use Case: 

Showing different product blocks for different categories of products based on what the customer told me they are shopping for. 

If they say they’re shopping for the Holidays can I say show this block if the date is after X and before X

and then show a different block during a different date range?


This way I can show Christmas stuff at one time of the year, and Mother’s Day items at another. 


Best answer by In the Inbox 30 August 2022, 16:46

View original

3 replies

Userlevel 6
Badge +25

Hi @Jessica eCommerce Badassery 

Great question! As far as I am aware, you can only use dynamic content based on data saved as a profile property or within an event metric.

How to show or hide template blocks based on Dynamic variables

However, based on how/when you want to send/trigger these particular messages to your subscribers, there still might be a way to do it. For example, if you trigger someone into a flow, you can use an Update Property step to set the current date, and then in the messages that follow can dynamically show content based on that property. 


Alternatively, you can use a date property to trigger someone into a date-based flow, but this would be based on a date saved to a profile property.


One thing to keep in mind is that the message you build will contain all of the content in the code of the email, either it’s shown or hidden. So if you plan to build out a lot of different blocks based on time of year, this will increase the “weight” of your message. The weight can impact how your message is shown in different ISPs. For example, Gmail allows emails up to 102KB before they start clipping the message. 


I know this wasn’t exactly what you are looking for, but wanted to share some alternative ideas to possibly make this work for your needs. 


@In the Inbox 

Userlevel 7
Badge +59

Hey @Jessica eCommerce Badassery,

Looks like @In the Inbox stole my thunder, but he’s absolutely spot on!

Our show/hide conditions only support logic based on profile properties and event data. However, nothing would be stopping you from using the method suggested by Bryan of storing a profile property for this exact use case. 

It may even be simpler to create a series of update profile property steps in a welcome flow so that everyone who enters a flow gets tagged with something like “Holiday 1 = Halloween”, “Holiday 2 = Christmas”, etc instead of storing the current dates as profile properties. You can obviously define your custom profile properties and value however you want, but using this method makes it so you wouldn’t need to build in any additional logic that comes with trying to define date ranges. 

I think this would also be a great use case for our Universal/Saved Content feature. Using this feature allows you to create sections in your email that can get updated across all your templates. For example, if you create a series of holiday specific content, you can simply drag and drop those saved content into your universal section that would get updated across your templates. This would also alleviate the chances of your emails getting clipped since you aren’t bloating up your email with hidden content. 

I hope this helps!


Userlevel 4
Badge +17

@In the Inbox @David To 


Thanks for your feedback! I’m the queen of workarounds, so not sure why I didn’t think of adding the date field. Duh. 

I also completely forgot about the universal blocks update!!!!!!!  I was waiting for this feature for so long, and now I’m forgetting I can even use it, haha. 

This is for a client, so I always worry about creating things they have to remember to manage in the future, but Uni content could be a relatively easy update with a calendar reminder. 


Thanks again!