Let email node be able to send blank topic

and let msg.description be " also
to close #959
This commit is contained in:
Dave Conway-Jones 2022-11-08 13:52:37 +00:00
parent 4c0ecc70bc
commit c3a5716fe7
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
5 changed files with 9 additions and 7 deletions

View File

@ -98,7 +98,8 @@ module.exports = function(RED) {
sendopts.headers = msg.headers;
sendopts.priority = msg.priority;
}
sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; // subject line
if (msg.hasOwnProperty("topic") && msg.topic === '') { sendopts.subject = ""; }
else { sendopts.subject = msg.topic || msg.title || "Message from Node-RED"; } // subject line
if (msg.hasOwnProperty("header") && msg.header.hasOwnProperty("message-id")) {
sendopts.inReplyTo = msg.header["message-id"];
sendopts.subject = "Re: " + sendopts.subject;
@ -119,7 +120,8 @@ module.exports = function(RED) {
sendopts.attachments[0].contentType = msg.headers["content-type"];
}
// Create some body text..
sendopts.text = RED._("email.default-message",{filename:fname, description:(msg.description||"")});
if (msg.hasOwnProperty("description")) { sendopts.text = msg.description; }
else { sendopts.text = RED._("email.default-message",{filename:fname}); }
}
else {
var payload = RED.util.ensureString(msg.payload);

View File

@ -36,7 +36,7 @@
"always": "immer",
"rejectUnauthorised": "Überprüfen sie, ob das serverzertifikat gültig ist"
},
"default-message": "__description__\n\nDatei von Node-RED ist angehängt: __filename__",
"default-message": "\nDatei von Node-RED ist angehängt: __filename__",
"tip": {
"cred": "<b>Hinweis</b>: Berechtigungen von globaler emailkeys.js-Datei kopiert",
"recent": "Tipp: Es wird nur die letzte E-Mail abgerufen",

View File

@ -42,10 +42,10 @@
"keyFile":"Private key",
"users": "Users",
"auth": "Authenticate users",
"addButton": "Add",
"addButton": "Add",
"expert": "Expert"
},
"default-message": "__description__\n\nFile from Node-RED is attached: __filename__",
"default-message": "\nFile from Node-RED is attached: __filename__",
"tip": {
"cred": "<b>Note:</b> Copied credentials from global emailkeys.js file.",
"recent": "Tip: Only retrieves the single most recent email.",

View File

@ -36,7 +36,7 @@
"always": "常時",
"rejectUnauthorised": "チェックサーバ証明書は有効です"
},
"default-message": "__description__\n\nNode-REDからファイルが添付されました: __filename__",
"default-message": "\nNode-REDからファイルが添付されました: __filename__",
"tip": {
"cred": "<b>注釈:</b> emailkeys.jsファイルから認証情報をコピーしました。",
"recent": "注釈: 最新のメールを1件のみ取得します。",

View File

@ -1,6 +1,6 @@
{
"name": "node-red-node-email",
"version": "1.18.1",
"version": "1.18.2",
"description": "Node-RED nodes to send and receive simple emails.",
"dependencies": {
"imap": "^0.8.19",