From 47e81e3ca181b55c264253f42ac8446f1db9fc58 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 25 Nov 2020 08:08:03 +0000 Subject: [PATCH] Fixed error when creating emails when track opens is disabled no issue - ensure `email.track_opens` is a boolean rather than `null` --- core/server/services/mega/mega.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/server/services/mega/mega.js b/core/server/services/mega/mega.js index 0c8088a341..b905283367 100644 --- a/core/server/services/mega/mega.js +++ b/core/server/services/mega/mega.js @@ -70,7 +70,7 @@ const sendTestEmail = async (postModel, toEmails) => { })); // enable tracking for previews to match real-world behaviour - emailData.track_opens = settingsCache.get('email_track_opens'); + emailData.track_opens = !!settingsCache.get('email_track_opens'); const response = await bulkEmailService.send(emailData, recipients); @@ -139,7 +139,7 @@ const addEmail = async (postModel, options) => { html: emailData.html, plaintext: emailData.plaintext, submitted_at: moment().toDate(), - track_opens: settingsCache.get('email_track_opens'), + track_opens: !!settingsCache.get('email_track_opens'), recipient_filter: emailRecipientFilter }, knexOptions); } else {