From 6dd15d3335bb6dcd89d4c4af5fc8a376b48f314d Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 10 Apr 2019 09:01:08 +0100 Subject: [PATCH] add to email msg.status and bump nodemailer version --- social/email/61-email.js | 8 ++++---- social/email/package.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index acf8ebd9..e9cc7974 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -116,10 +116,10 @@ module.exports = function(RED) { smtpTransport.sendMail(sendopts, function(error, info) { if (error) { node.error(error,msg); - node.status({fill:"red",shape:"ring",text:"email.status.sendfail"}); + node.status({fill:"red",shape:"ring",text:"email.status.sendfail",response:error.response,msg:{to:msg.to,topic:msg.topic,id:msg._msgid}}); } else { node.log(RED._("email.status.messagesent",{response:info.response})); - node.status({}); + node.status({text:"",response:info.response,msg:{to:msg.to,topic:msg.topic,id:msg._msgid}}); } }); } @@ -357,7 +357,7 @@ module.exports = function(RED) { //console.log("> search - err=%j, results=%j", err, results); if (results.length === 0) { //console.log(" [X] - Nothing to fetch"); - node.status({}); + node.status({results:0}); imap.end(); s = false; setInputRepeatTimeout(); @@ -397,7 +397,7 @@ module.exports = function(RED) { // When we have fetched all the messages, we don't need the imap connection any more. fetch.on('end', function() { - node.status({}); + node.status({results:results.length}); var cleanup = function() { imap.end(); s = false; diff --git a/social/email/package.json b/social/email/package.json index 62e3ac5f..28a7884a 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,11 +1,11 @@ { "name": "node-red-node-email", - "version": "1.3.0", + "version": "1.4.0", "description": "Node-RED nodes to send and receive simple emails", "dependencies": { "imap": "^0.8.19", "mailparser-mit": "^1.0.0", - "nodemailer": "^4.7.0", + "nodemailer": "^5.1.1", "poplib": "^0.1.7" }, "repository": {