mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
refix email attachments array
This commit is contained in:
parent
4697636055
commit
1c256fd3b3
@ -119,15 +119,16 @@ module.exports = function(RED) {
|
||||
else {
|
||||
var payload = RED.util.ensureString(msg.payload);
|
||||
sendopts.text = payload; // plaintext body
|
||||
if (/<[a-z][\s\S]*>/i.test(payload)) {
|
||||
if (/<[a-z][\s\S]*>/i.test(payload)) {
|
||||
sendopts.html = payload; // html body
|
||||
if (msg.hasOwnProperty("plaintext")) {
|
||||
var plaintext = RED.util.ensureString(msg.plaintext);
|
||||
sendopts.text = plaintext; // plaintext body - specific plaintext version
|
||||
}
|
||||
}
|
||||
if (msg.attachments && Array.isArray(msg.attachments)) {
|
||||
sendopts.attachments = msg.attachments;
|
||||
if (msg.attachments) {
|
||||
if (!Array.isArray(msg.attachments)) { sendopts.attachments = [ msg.attachments ]; }
|
||||
else { sendopts.attachments = msg.attachments; }
|
||||
for (var a=0; a < sendopts.attachments.length; a++) {
|
||||
if (sendopts.attachments[a].hasOwnProperty("content")) {
|
||||
if (typeof sendopts.attachments[a].content !== "string" && !Buffer.isBuffer(sendopts.attachments[a].content)) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-node-email",
|
||||
"version": "1.10.1",
|
||||
"version": "1.11.0",
|
||||
"description": "Node-RED nodes to send and receive simple emails.",
|
||||
"dependencies": {
|
||||
"imap": "^0.8.19",
|
||||
|
Loading…
Reference in New Issue
Block a user