diff --git a/social/email/61-email.js b/social/email/61-email.js index b21f1e9e..d22ced3a 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -90,12 +90,13 @@ module.exports = function(RED) { if ((msg.payload[0] === 0x89)&&(msg.payload[1] === 0x50)) { fe = "png"; } //4E msg.filename = "attachment."+fe; } - sendopts.attachments = [ { content: msg.payload, filename:(msg.filename.replace(/^.*[\\\/]/, '') || "file.bin") } ]; + var fname = msg.filename.replace(/^.*[\\\/]/, '') || "file.bin"; + sendopts.attachments = [ { content:msg.payload, filename:fname } ]; if (msg.hasOwnProperty("headers") && msg.headers.hasOwnProperty("content-type")) { sendopts.attachments[0].contentType = msg.headers["content-type"]; } // Create some body text.. - sendopts.text = RED._("email.default-message",{filename:(msg.filename.replace(/^.*[\\\/]/, '') || "file.bin"),description:(msg.hasOwnProperty("description") ? "\n\n"+msg.description : "")}); + sendopts.text = RED._("email.default-message",{filename:fname, description:(msg.description||"")}); } else { var payload = RED.util.ensureString(msg.payload); diff --git a/social/email/locales/en-US/61-email.json b/social/email/locales/en-US/61-email.json index c85ffbfd..3bbcf71f 100644 --- a/social/email/locales/en-US/61-email.json +++ b/social/email/locales/en-US/61-email.json @@ -13,10 +13,7 @@ "useSSL": "Use SSL?", "disposition": "Disposition" }, - - "default-message": "Your file from Node-RED is attached: __filename__ __description__", - - + "default-message": "__description__\n\nFile from Node-RED is attached: __filename__", "tip": { "cred": "Note: Copied credentials from global emailkeys.js file.", "recent": "Tip: Only retrieves the single most recent email." @@ -39,7 +36,7 @@ "nopassword": "No e-mail password set", "nocredentials": "No Email credentials found. See info panel.", "nosmtptransport": "No SMTP transport. See info panel.", - "nopayload": "No payload to send", + "nopayload": "No payload to send", "fetchfail": "Failed to fetch folder: __folder__", "messageerror": "Fetch message error: __error__" } diff --git a/social/email/package.json b/social/email/package.json index e1c9258d..60758e8d 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-email", - "version": "0.1.21", + "version": "0.1.22", "description": "Node-RED nodes to send and receive simple emails", "dependencies": { "nodemailer": "^1.11.0",