kumarabhirup / bulk-mail-cli

Do quick, hassle-free email marketing with this small but very powerful tool! 🔥
https://bulkmail.now.sh
GNU General Public License v3.0
121 stars 24 forks source link

feat: Scheduler #28

Open ghost opened 4 years ago

ghost commented 4 years ago

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

kumarabhirup commented 4 years ago

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

koppor commented 4 years ago

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

kumarabhirup commented 4 years ago

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.