Filter a segment dynamically, datetime field = now

Your software
My Mautic version is: 4.20
My PHP version is: 7.4.28
My Database type and version is: 10.3.34-MariaDB-log-cll-lve

Your problem
My problem is:
Im trying to filter a segment dynamically.

I have contacts with a DateTime field:

I would like for the contacts to populate a segment depending on the DateTime field. So my filter looks like this:

I read somewhere in the forum here that you can use ‘now’ to allow the filter to always have the correct date/time (maybe I misunderstood). But for the life of me, I cant get that to work.

If I enter ‘now’, the actual DateTime gets saved (and the filter works great but is ofc static).

I have tried =now, now() and so on, but I can’t get it to work.

Anyone that can point me in the right direction?

Hello @CarlJohan,

What is your use case?


Hi @pierre_a , thanks for answering.

So, I have a list of recipients. Some of these recipients are in the US, some in Europe. I want to send the emails at the same time to all of them (let’s say noon). The easiest way would be to simply set a field in my original datasource with the time and date that the email should go out, and then when I import to Mautic, I have a field that is a datetime field that controls when the email will be sent.

It might sound complex, but it’s the workflow that I prefer.

I have solved this by writing a PHP script (triggered every 5 min with a cron), that updates the segment filter (basically sets the DateTime field to the current date and time), and that works great, but it’s a bit clumsy.

Any ideas on how to achieve this out of the box?

Hello @CarlJohan,

You write " want to send the emails at the same time to all of them (let’s say noon)."

Why it’s important for business?


Request from client.

Hello @CarlJohan,

I understand that this is a customer request.
I think the problem is taken the wrong way.
If the business use case is not understandable by the community, it will be difficult to imagine the best solution :wink:

It is already possible to choose a sending window with dates and times in Mautic.
Potentially with one Mautic instance per country (or geographical area).
Does this fulfill the need?