0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Improved bulk email service

no-issue

Used proper logging
This commit is contained in:
Fabien O'Carroll 2019-11-04 12:36:10 +07:00
parent e63083cd32
commit 8503105b39

View file

@ -1,6 +1,7 @@
// @ts-check
const mailService = require('../mail');
const ghostMailer = new mailService.GhostMailer();
const common = require('../../lib/common');
/*
* An email address
@ -11,6 +12,7 @@ const ghostMailer = new mailService.GhostMailer();
* An object representing an email to send
* @typedef { Object } Email
* @property { string } html - The html content of the email
* @property { string } subject - The subject of the email
*/
module.exports = {
@ -28,7 +30,7 @@ module.exports = {
await ghostMailer.send(messageToSend);
} catch (err) {
// @TODO log this somewhere with state?
console.log(`Oh no! an email failed to send :( ${recipient}`);
common.logging.warn(`Oh no! an email failed to send :( ${recipient}`);
}
}
return true;