Solved

Dynamic content in Flow based on date in person custom field

  • 27 August 2022
  • 3 replies
  • 138 views

Badge +1

Hi 

I’d like to show a section depending of the custom property “last_purchased_date property” (send via API in a date format) of my profiles. 

I’d like to show the section for people where last_purchased_date is at least 60 days from today. 

 

I tried this but it doesn’t work :

{% today '%Y-%m-%d' as today %} {{ today|days_before:15|format_date_string|date:'M d' }} and person.last_purchase_type == booking

Thanks,

icon

Best answer by Dov 30 August 2022, 15:28

View original

3 replies

Userlevel 7
Badge +61

Hi @winawina,

Thanks for sharing this with the community.

You can try using the timesince filter. Alternatively, if you’re using a flow to send out this information, simply using a 60 day time-delay followed by an email containing the tag for “last_purchased_date property”. Or, create a segment: What somebody has done > placed order > at least 60 days ago and including the tag for “last_purchased_date property” and use the segment as a trigger for your flow, or simply send a campaign to that segment, are other ways to approach this.

I hope that’s helpful.

Badge +1

Hi @Dov , 
Thanks for your answer. 

It seems we can’t use Timesince for what we are trying to achieve (info here). 
Unfortunately we don’t use flows so we really need the filter to work in the newsletter .. 
The segment can be an option but we wanted to avoid doing a lot of different campaigns to better measure results as we already have to do it in 2 langs. 

Userlevel 7
Badge +61

Hi @winawina,

Thank you for your reply.

I recommend referencing Django’s documentation to find a tag that would equate to “days_before” (as far as I can tell, Django only offers days_later). In absence of this tag, I recommend segmenting your audiences (What somebody has done > placed order > at least 60 days ago) and sending campaigns to those segments. I know this is not the preferred method, but it would be the most viable in absence of the tag.

I hope that’s helpful and thanks for being a community member.

 

Reply