Skip to content

Commit

Permalink
Improved bulk email service
Browse files Browse the repository at this point in the history
no-issue

Used proper logging
  • Loading branch information
allouis committed Nov 4, 2019
1 parent e63083c commit 8503105
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/server/services/bulk-email/index.js
@@ -1,6 +1,7 @@
// @ts-check
const mailService = require('../mail');
const ghostMailer = new mailService.GhostMailer();
const common = require('../../lib/common');

/*
* An email address
Expand All @@ -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 = {
Expand All @@ -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;
Expand Down

0 comments on commit 8503105

Please sign in to comment.