Added option to schedule sending
This commit is contained in:
parent
2196503cae
commit
e396219c03
6 changed files with 95 additions and 18 deletions
|
@ -20,7 +20,7 @@ function findUnsent(callback) {
|
|||
return callback(err);
|
||||
}
|
||||
|
||||
let query = 'SELECT id, list, segment FROM campaigns WHERE status=? LIMIT 1';
|
||||
let query = 'SELECT `id`, `list`, `segment` FROM `campaigns` WHERE `status`=? AND (`scheduled` IS NULL OR `scheduled` <= NOW()) LIMIT 1';
|
||||
connection.query(query, [2], (err, rows) => {
|
||||
if (err) {
|
||||
connection.release();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue