@5minds/node-red-contrib-processcube-tools 1.0.1-feature-122227-mfgey2et → 1.0.1-feature-fb6fa7-mfgfje50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/email-sender/email-sender.js +14 -1
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ module.exports = function(RED) {
|
|
|
18
18
|
const bcc = RED.util.evaluateNodeProperty(config.bcc, config.bccType, node, msg) || "";
|
|
19
19
|
const subject = RED.util.evaluateNodeProperty(config.subject, config.subjectType, node, msg) || msg.topic || "Message from Node-RED";
|
|
20
20
|
const htmlContent = RED.util.evaluateNodeProperty(config.htmlContent, config.htmlContentType, node, msg);
|
|
21
|
-
const attachments =
|
|
21
|
+
const attachments = safeEvaluatePropertyAttachment(config, node, msg);
|
|
22
22
|
|
|
23
23
|
// Retrieve and evaluate SMTP configuration values
|
|
24
24
|
const host = RED.util.evaluateNodeProperty(config.host, config.hostType, node, msg);
|
|
@@ -111,4 +111,17 @@ module.exports = function(RED) {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
RED.nodes.registerType("email-sender", EmailSenderNode);
|
|
114
|
+
|
|
115
|
+
function safeEvaluatePropertyAttachment(config, node, msg) {
|
|
116
|
+
if (config.attachments && config.attachments.trim() !== '') {
|
|
117
|
+
try {
|
|
118
|
+
return RED.util.evaluateNodeProperty(config.attachments, config.attachmentsType, node, msg);
|
|
119
|
+
} catch (e) {
|
|
120
|
+
node.error("Failed to evaluate attachments property: " + e.message, msg);
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
114
127
|
};
|
package/package.json
CHANGED