Send triggered campaigns only to active subscribers

This commit is contained in:
Gernot Pansy 2019-10-10 12:37:31 +02:00
parent cbf2a6e39d
commit fe39ec5134

View file

@ -52,6 +52,7 @@ async function run() {
.where(function () { .where(function () {
addSegmentQuery(this); addSegmentQuery(this);
}) })
.where(subsTable + '.status', SubscriptionStatus.SUBSCRIBED)
.whereNull('related_trigger_messages.id') // This means only those where the trigger has not fired yet somewhen in the past .whereNull('related_trigger_messages.id') // This means only those where the trigger has not fired yet somewhen in the past
.select(subsTable + '.id'); .select(subsTable + '.id');