0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed error when creating emails when track opens is disabled

no issue

- ensure `email.track_opens` is a boolean rather than `null`
This commit is contained in:
Kevin Ansfield 2020-11-25 08:08:03 +00:00
parent 0e78f2ed63
commit 47e81e3ca1

View file

@ -70,7 +70,7 @@ const sendTestEmail = async (postModel, toEmails) => {
})); }));
// enable tracking for previews to match real-world behaviour // 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); const response = await bulkEmailService.send(emailData, recipients);
@ -139,7 +139,7 @@ const addEmail = async (postModel, options) => {
html: emailData.html, html: emailData.html,
plaintext: emailData.plaintext, plaintext: emailData.plaintext,
submitted_at: moment().toDate(), submitted_at: moment().toDate(),
track_opens: settingsCache.get('email_track_opens'), track_opens: !!settingsCache.get('email_track_opens'),
recipient_filter: emailRecipientFilter recipient_filter: emailRecipientFilter
}, knexOptions); }, knexOptions);
} else { } else {