Duration in "Automatic actions"

I can’t figure out the duration part.

Is it so that:

Duration = 1 day means that the duedate is +/- 12 hours ?
Duration = 2 days means that the duedate is between 24 hours and 48 hours?

Duration refers to the time before due. So, Duration of 1, would start sending emails 86400 seconds before the due date. Duration of 2, would start sending emails 172800 seconds before the due date. And so forth. Now keep in mind, duration is relative to the task due date down to the time as well as, when your cron runs, so, its possible that if your cron runs only once per day, that it may not actually be a duration of 1 at the time the cron runs, but the next day it will. So, if you want better accuracy, run your cron more.

The logic is here, if you want to take a look:

Tanks for quick and complementary answer.

I run my cron once a day @0800. In my case I get emails about tasks with due date a few days ago and is triggered by a 1 day action (the title in the email says that its is triggered by the 1 day action). It seems that it also go back in time, not only impending due dates.

Is it not possible to run more than one notification per task without deleting the row in the table task_has_metadata? I’m trying to notify to the users that a task needs to be solved within 48 hours and 24 hours if it is still open.

Once the task is within the duration, it will email daily, until the task is complete.

But to answer your question, it wouldn’t be hard to modify the code, to be specific to your need.

For example, you could change “duration” to be “duration before due date” and then add “duration after due date” to create a range.