From b0762e623f1fec6979c2af916c40c1353064e411 Mon Sep 17 00:00:00 2001 From: Thibaut Patel Date: Thu, 8 Jul 2021 18:34:30 +0200 Subject: [PATCH] Enabled removing all segmented email cards when the memberSegment is null no issue - In the current iteration of the gated email project, we are returning a null segment instead of returning the correct list of segmented users as a temporary measure. The expectation was to clear all segmented cards and it's now the case. --- core/server/services/bulk-email/bulk-email-processor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/server/services/bulk-email/bulk-email-processor.js b/core/server/services/bulk-email/bulk-email-processor.js index 86fe1a419b..5b237db6b2 100644 --- a/core/server/services/bulk-email/bulk-email-processor.js +++ b/core/server/services/bulk-email/bulk-email-processor.js @@ -9,6 +9,7 @@ const mailgunProvider = require('./mailgun'); const sentry = require('../../../shared/sentry'); const debug = require('@tryghost/debug')('mega'); const postEmailSerializer = require('../mega/post-email-serializer'); +const labs = require('../../../shared/labs'); const BATCH_SIZE = mailgunProvider.BATCH_SIZE; @@ -230,7 +231,7 @@ module.exports = { recipientData[recipient.member_email] = data; }); - if (memberSegment) { + if (labs.isSet('emailCardSegments')) { emailData = postEmailSerializer.renderEmailForSegment(emailData, memberSegment); }