Scheduling On Event Scenarios
Are you planning a holiday, but you want to schedule your OnEvent scenario now? We got you covered with this guide.
You can make a custom Jinja condition that will start matching customers only from some point of time in the future.
You would need a bit of Jinja code and this website.
This is the Jinja code which you need to insert into a custom-coded condition:
{% set ScheduledTime = 1680683755 %}
{% set CurrentTime = time %}
{% if ScheduledTime <= CurrentTime %}
True
{% else %}
False
{% endif %}
You need to set two variables, one is ScheduledTime, which represents the UNIX timestamp of the DateTime from when you want this scenario to be active, and the second variable is the CurrentTime which is literally the current UNIX timestamp.
Then you need to use a simple if condition that will check if the ScheduledTime is less or equal to the current time, and if it is, the condition will be matched due to rendered True statement.
If the ScheduledTime is larger than the CurrentTime, the condition will not match anyone due to rendered False statement.
All you need to do when you want it to schedule for a particular time is to go to the above-mentioned UNIX timestamp website, enter the day and time when you want the scenario to become active and copy the UNIX timestamp and paste it into the JINJA code.
After this, you need to insert the JINJA code inside the condition. This is done easily by switching to the code editor.
Now you are ready to go, you can insert this condition behind your OnEvent trigger and start your scenario. It will be triggered by a OnEvent, but this condition will start letting customers go through only after the ScheduledTime is reached. You can remove that condition when needed after you return.
Updated 11 months ago