bulk-mail-cli icon indicating copy to clipboard operation
bulk-mail-cli copied to clipboard

feat: Scheduler

Open ghost opened this issue 5 years ago • 3 comments

I'd like my mails to only be sent at certain hours for example: between 9 AM and 5 PM.

ghost avatar May 15 '20 13:05 ghost

The bulk-mail-cli configuration has an interval config that can take a cron setting.

So what you want is technically achievable in bulk-mail-cli v2.

{
...
"configuration": {
    "mailInterval": "*/10 * * * * *", // Cron Expression: To mail every 10 seconds [ >= 10 seconds recommended ]
  }
...
}

Reference Link: https://stackoverflow.com/questions/41743720/crontab-run-every-15-minutes-between-certain-hours

In case I am incorrect or something doesn't work, let me know, I can create a separate feature for this :D

kumarabhirup avatar May 15 '20 15:05 kumarabhirup

I don't understand the semantics of mailInterval. A) Is the same email sent each 10 seconds to all receipient? B) Is the same email mails once to one receipient and then in next interval to the next one?

Refs https://github.com/adventmail/bulk-mail-cli/issues/27

koppor avatar Jul 26 '20 21:07 koppor

Yes. It's B). It sends email once and then after the interval to the next one and so on.

By the way, make sure you set the cron string to at least 2 minutes as the cron has hard time working with seconds. Will add this in next update.

kumarabhirup avatar Jul 31 '20 11:07 kumarabhirup