From 24100d6f836e65584a0688f4ef6f65134f070e62 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 22 Jun 2018 11:58:22 +0200 Subject: [PATCH] Log mail --- utils/mail.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/mail.js b/utils/mail.js index 5841e44..4099a70 100644 --- a/utils/mail.js +++ b/utils/mail.js @@ -1,3 +1,4 @@ +const log = require('utils/log'); const config = require('settings/config'); const mail = require('emailjs'); @@ -10,5 +11,12 @@ module.exports = function(params, callback) { tls: config.MAIL.TLS }); - server.send(params, callback); + server.send(params, function(err) { + if (err === null) { + log.debug("Mail sent successfully"); + } else { + log.debug("Error in sending mail " + err); + } + callback(); + }); };