From 07856d34a2c5d02d81d05ce50a5f138a0b941416 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 8 Mar 2020 15:29:53 +0530 Subject: [PATCH] Fix bug in e-mail scheduling --- queries.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries.sql b/queries.sql index f07bfad..75e9c4d 100644 --- a/queries.sql +++ b/queries.sql @@ -442,7 +442,7 @@ WITH camps AS ( SELECT campaigns.*, COALESCE(templates.body, (SELECT body FROM templates WHERE is_default = true LIMIT 1)) AS template_body FROM campaigns LEFT JOIN templates ON (templates.id = campaigns.template_id) - WHERE (status='running' OR (status='scheduled' AND campaigns.send_at >= NOW())) + WHERE (status='running' OR (status='scheduled' AND NOW() >= campaigns.send_at)) AND NOT(campaigns.id = ANY($1::INT[])) ), campLists AS (