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.
This commit is contained in:
Thibaut Patel 2021-07-08 18:34:30 +02:00
parent ff8e6e35b6
commit b0762e623f

View File

@ -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);
}