1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

handle pure plain text messages in email node.

This commit is contained in:
dceejay 2015-04-11 16:48:50 +01:00
parent 1014abe92f
commit 8dc98420db

View File

@ -201,8 +201,10 @@ module.exports = function(RED) {
if (parts[p].indexOf("text/plain") >= 0) { if (parts[p].indexOf("text/plain") >= 0) {
pay.payload = parts[p].split("\n").slice(1,-2).join("\n").trim(); pay.payload = parts[p].split("\n").slice(1,-2).join("\n").trim();
} }
if (parts[p].indexOf("text/html") >= 0) { else if (parts[p].indexOf("text/html") >= 0) {
pay.html = parts[p].split("\n").slice(1,-2).join("\n").trim(); pay.html = parts[p].split("\n").slice(1,-2).join("\n").trim();
} else {
pay.payload = parts[0];
} }
} }
//pay.body = buffer; //pay.body = buffer;