@5minds/node-red-contrib-processcube-tools 1.0.1 → 1.0.2-develop-e3d5d9-mfm8oea8

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.
@@ -0,0 +1,306 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('email-sender', {
3
+ category: 'ProcessCube Tools',
4
+ color: '#02AFD6',
5
+ defaults: {
6
+ name: { value: '' },
7
+ // Mail fields
8
+ sender: {
9
+ value: 'Stoelting Ticket-System',
10
+ required: true,
11
+ validate: RED.validators.typedInput('senderType'),
12
+ },
13
+ senderType: { value: 'str' },
14
+ address: { value: '', required: true, validate: RED.validators.typedInput('addressType') },
15
+ addressType: { value: 'str' },
16
+ to: { value: '', required: true, validate: RED.validators.typedInput('toType') },
17
+ toType: { value: 'str' },
18
+ cc: { value: '', validate: RED.validators.typedInput('ccType') },
19
+ ccType: { value: 'str' },
20
+ bcc: { value: '', validate: RED.validators.typedInput('bccType') },
21
+ bccType: { value: 'str' },
22
+ replyTo: { value: '', validate: RED.validators.typedInput('replyToType') },
23
+ replyToType: { value: 'str' },
24
+ subject: { value: '', required: true, validate: RED.validators.typedInput('subjectType') },
25
+ subjectType: { value: 'str' },
26
+ htmlContent: { value: '', required: true, validate: RED.validators.typedInput('htmlContentType') },
27
+ htmlContentType: { value: 'str' },
28
+ attachments: { value: '', required: false },
29
+ attachmentsType: { value: 'msg' },
30
+
31
+ // SMTP-Fields
32
+ host: { value: '', required: true, validate: RED.validators.typedInput('hostType') },
33
+ hostType: { value: 'str' },
34
+ port: { value: '', required: true, validate: RED.validators.typedInput('portType') },
35
+ portType: { value: 'num' },
36
+ user: { value: '', required: true, validate: RED.validators.typedInput('userType') },
37
+ userType: { value: 'str' },
38
+ password: { value: '', required: true, type: 'password' },
39
+ passwordType: { value: 'env', required: true },
40
+ secure: { value: '', required: true, validate: RED.validators.typedInput('secureType') },
41
+ secureType: { value: 'bool' },
42
+ rejectUnauthorized: {
43
+ value: '',
44
+ required: true,
45
+ validate: RED.validators.typedInput('rejectUnauthorizedType'),
46
+ },
47
+ rejectUnauthorizedType: { value: 'bool' },
48
+ },
49
+ inputs: 1,
50
+ outputs: 1,
51
+ icon: 'font-awesome/fa-paper-plane',
52
+ label: function () {
53
+ return this.name || 'E-Mail Sender';
54
+ },
55
+ oneditprepare: function () {
56
+ // Mail Fields
57
+ $('#node-input-sender').typedInput({
58
+ default: 'str',
59
+ types: ['str', 'msg', 'flow', 'global', 'env'],
60
+ typeField: '#node-input-senderType',
61
+ });
62
+ $('#node-input-address').typedInput({
63
+ default: 'str',
64
+ types: ['str', 'msg', 'flow', 'global', 'env'],
65
+ typeField: '#node-input-addressType',
66
+ });
67
+ $('#node-input-to').typedInput({
68
+ default: 'str',
69
+ types: ['str', 'msg', 'flow', 'global', 'env'],
70
+ typeField: '#node-input-toType',
71
+ });
72
+ $('#node-input-cc').typedInput({
73
+ default: 'str',
74
+ types: ['str', 'msg', 'flow', 'global', 'env'],
75
+ typeField: '#node-input-ccType',
76
+ });
77
+ $('#node-input-bcc').typedInput({
78
+ default: 'str',
79
+ types: ['str', 'msg', 'flow', 'global', 'env'],
80
+ typeField: '#node-input-bccType',
81
+ });
82
+ $('#node-input-replyTo').typedInput({
83
+ default: 'str',
84
+ types: ['str', 'msg', 'flow', 'global', 'env'],
85
+ typeField: '#node-input-replyToType',
86
+ });
87
+ $('#node-input-subject').typedInput({
88
+ default: 'str',
89
+ types: ['str', 'msg', 'flow', 'global', 'env'],
90
+ typeField: '#node-input-subjectType',
91
+ });
92
+ $('#node-input-htmlContent').typedInput({
93
+ default: 'str',
94
+ types: ['str', 'msg', 'flow', 'global', 'json'],
95
+ typeField: '#node-input-htmlContentType',
96
+ });
97
+ $('#node-input-attachments').typedInput({
98
+ default: 'msg',
99
+ types: ['msg', 'flow', 'global'],
100
+ typeField: '#node-input-attachmentsType',
101
+ });
102
+
103
+ // SMTP Fields
104
+ $('#node-input-host').typedInput({
105
+ default: 'str',
106
+ types: ['str', 'msg', 'flow', 'global', 'env'],
107
+ typeField: '#node-input-hostType',
108
+ });
109
+ $('#node-input-port').typedInput({
110
+ default: 'num',
111
+ types: ['num', 'msg', 'flow', 'global', 'env'],
112
+ typeField: '#node-input-portType',
113
+ });
114
+ $('#node-input-user').typedInput({
115
+ default: 'str',
116
+ types: ['str', 'msg', 'flow', 'global', 'env'],
117
+ typeField: '#node-input-userType',
118
+ });
119
+ $('#node-input-password').typedInput({
120
+ default: 'env',
121
+ types: ['msg', 'flow', 'global', 'env'],
122
+ typeField: '#node-input-passwordType',
123
+ });
124
+ $('#node-input-secure').typedInput({
125
+ default: 'bool',
126
+ types: ['bool', 'msg', 'flow', 'global', 'env'],
127
+ typeField: '#node-input-secureType',
128
+ });
129
+ $('#node-input-rejectUnauthorized').typedInput({
130
+ default: 'bool',
131
+ types: ['bool', 'msg', 'flow', 'global', 'env'],
132
+ typeField: '#node-input-rejectUnauthorizedType',
133
+ });
134
+ },
135
+ });
136
+ </script>
137
+
138
+ <script type="text/html" data-template-name="email-sender">
139
+ <div class="form-row">
140
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
141
+ <input type="text" id="node-input-name" placeholder="Name" />
142
+ </div>
143
+
144
+ <h3>Mail Configuration</h3>
145
+ <div class="form-row">
146
+ <label for="node-input-sender"><i class="fa fa-user"></i> Sender</label>
147
+ <input type="text" id="node-input-sender" placeholder="John Doe" />
148
+ <input type="hidden" id="node-input-senderType" />
149
+ </div>
150
+ <div class="form-row">
151
+ <label for="node-input-address"><i class="fa fa-envelope"></i> Address</label>
152
+ <input type="text" id="node-input-address" placeholder="john.doe@example.com" />
153
+ <input type="hidden" id="node-input-addressType" />
154
+ </div>
155
+ <div class="form-row">
156
+ <label for="node-input-to"><i class="fa fa-user"></i> To</label>
157
+ <input type="text" id="node-input-to" placeholder="my.test@example.com" />
158
+ <input type="hidden" id="node-input-toType" />
159
+ </div>
160
+ <div class="form-row">
161
+ <label for="node-input-cc"><i class="fa fa-user-plus"></i> CC</label>
162
+ <input type="text" id="node-input-cc" />
163
+ <input type="hidden" id="node-input-ccType" />
164
+ </div>
165
+ <div class="form-row">
166
+ <label for="node-input-bcc"><i class="fa fa-user-secret"></i> BCC</label>
167
+ <input type="text" id="node-input-bcc" />
168
+ <input type="hidden" id="node-input-bccType" />
169
+ </div>
170
+ <div class="form-row">
171
+ <label for="node-input-replyTo"><i class="fa fa-mail-reply"></i> Reply To</label>
172
+ <input type="text" id="node-input-replyTo" />
173
+ <input type="hidden" id="node-input-replyToType" />
174
+ </div>
175
+ <div class="form-row">
176
+ <label for="node-input-subject"><i class="fa fa-info-circle"></i> Subject</label>
177
+ <input type="text" id="node-input-subject" />
178
+ <input type="hidden" id="node-input-subjectType" />
179
+ </div>
180
+ <div class="form-row">
181
+ <label for="node-input-htmlContent"><i class="fa fa-file-code-o"></i> HTML Content</label>
182
+ <input type="text" id="node-input-htmlContent" />
183
+ <input type="hidden" id="node-input-htmlContentType" />
184
+ </div>
185
+ <div class="form-row">
186
+ <label for="node-input-attachments"><i class="fa fa-paperclip"></i> Attachments</label>
187
+ <input type="text" id="node-input-attachments" />
188
+ <input type="hidden" id="node-input-attachmentsType" />
189
+ </div>
190
+
191
+ <h3>SMTP Configuration</h3>
192
+ <div class="form-row">
193
+ <label for="node-input-host"><i class="fa fa-server"></i> Host</label>
194
+ <input type="text" id="node-input-host" placeholder="smtp.gmail.com" />
195
+ <input type="hidden" id="node-input-hostType" />
196
+ </div>
197
+ <div class="form-row">
198
+ <label for="node-input-port"><i class="fa fa-plug"></i> Port</label>
199
+ <input type="text" id="node-input-port" placeholder="587" />
200
+ <input type="hidden" id="node-input-portType" />
201
+ </div>
202
+ <div class="form-row">
203
+ <label for="node-input-user"><i class="fa fa-user"></i> User</label>
204
+ <input type="text" id="node-input-user" placeholder="test.user@config.com" />
205
+ <input type="hidden" id="node-input-userType" />
206
+ </div>
207
+ <div class="form-row">
208
+ <label for="node-input-password"><i class="fa fa-lock"></i> Password</label>
209
+ <input type="password" id="node-input-password" />
210
+ <input type="hidden" id="node-input-passwordType" />
211
+ </div>
212
+ <div class="form-row">
213
+ <label for="node-input-secure"><i class="fa fa-shield"></i> SSL/TLS (Secure)</label>
214
+ <input type="text" id="node-input-secure" />
215
+ <input type="hidden" id="node-input-secureType" />
216
+ </div>
217
+ <div class="form-row">
218
+ <label for="node-input-rejectUnauthorized"><i class="fa fa-ban"></i> Reject Unauthorized</label>
219
+ <input type="text" id="node-input-rejectUnauthorized" />
220
+ <input type="hidden" id="node-input-rejectUnauthorizedType" />
221
+ </div>
222
+ </script>
223
+
224
+ <script type="text/html" data-help-name="email-sender">
225
+ <p>
226
+ A custom node to send emails using an SMTP server. The configuration for each field can be sourced from a fixed
227
+ value, or from a <code>msg</code>, <code>flow</code>, <code>global</code>, or <code>env</code> variable.
228
+ </p>
229
+
230
+ <h3>Configuration</h3>
231
+ <p>
232
+ Every field on the configuration panel is a <b>typed input</b>. Use the dropdown menu next to each field to
233
+ select the source of its value. Note that <b>Sender</b>, <b>Address</b>, <b>To</b>, <b>Subject</b>, and
234
+ <b>HTML Content</b> are required fields and must be configured before the node can be deployed.
235
+ </p>
236
+
237
+ <h4>Mail Configuration</h4>
238
+ <dl class="message-properties">
239
+ <dt>Sender <span class="property-type">string | variable</span></dt>
240
+ <dd>The name of the sender, as displayed to the recipient.</dd>
241
+
242
+ <dt>Address <span class="property-type">string | variable</span></dt>
243
+ <dd>The sender's email address.</dd>
244
+
245
+ <dt>To <span class="property-type">string | variable</span></dt>
246
+ <dd>The primary recipient's email address. Separate multiple addresses with a comma.</dd>
247
+
248
+ <dt>CC <span class="property-type">string | variable</span></dt>
249
+ <dd>Addresses to be carbon-copied on the email.</dd>
250
+
251
+ <dt>BCC <span class="property-type">string | variable</span></dt>
252
+ <dd>Addresses to be blind-carbon-copied on the email.</dd>
253
+
254
+ <dt>Reply To <span class="property-type">string | variable</span></dt>
255
+ <dd>Address that is being set as the that will be set, if the user presses the reply button.
256
+ Can be different than the email, that has sent the email.</dd>
257
+
258
+ <dt>Subject <span class="property-type">string | variable</span></dt>
259
+ <dd>The subject line of the email.</dd>
260
+
261
+ <dt>HTML Content <span class="property-type">string | variable</span></dt>
262
+ <dd>The HTML body of the email.</dd>
263
+
264
+ <dt>Attachments <span class="property-type">array | variable</span></dt>
265
+ <dd>A list of file attachments. This should be a variable containing an array of attachment objects.</dd>
266
+ </dl>
267
+
268
+ <h4>SMTP Configuration</h4>
269
+ <dl class="message-properties">
270
+ <dt>Host <span class="property-type">string | variable</span></dt>
271
+ <dd>The hostname or IP address of the SMTP server.</dd>
272
+
273
+ <dt>Port <span class="property-type">number | variable</span></dt>
274
+ <dd>The port number of the SMTP server.</dd>
275
+
276
+ <dt>User <span class="property-type">string | variable</span></dt>
277
+ <dd>The username for SMTP authentication.</dd>
278
+
279
+ <dt>Password <span class="property-type">string | variable</span></dt>
280
+ <dd>The password for SMTP authentication.</dd>
281
+
282
+ <dt>SSL/TLS (Secure) <span class="property-type">boolean | variable</span></dt>
283
+ <dd>
284
+ Use a secure connection. Set to <code>true</code> for SSL/TLS, <code>false</code> for a non-secure
285
+ connection.
286
+ </dd>
287
+
288
+ <dt>Reject Unauthorized <span class="property-type">boolean | variable</span></dt>
289
+ <dd>If <code>true</code>, the server's certificate is rejected if it's not authorized by a trusted CA.</dd>
290
+ </dl>
291
+
292
+ <h3>Usage</h3>
293
+ <p>
294
+ Inject a message to trigger the node and send an email.<br />
295
+ Credentials and other properties can be provided via message properties, flow/global context, or environment
296
+ variables.<br />
297
+ The node supports sending HTML emails and attachments.
298
+ </p>
299
+
300
+ <h3>Tips</h3>
301
+ <p>
302
+ <b>HTML Content Creation:</b><br />
303
+ To generate or format HTML content for your email, you can use a <b>template node</b> before the email-sender
304
+ node. This allows you to create dynamic and customized email bodies.
305
+ </p>
306
+ </script>
@@ -0,0 +1,174 @@
1
+ module.exports = function (RED) {
2
+ 'use strict';
3
+ const nodemailer = require('nodemailer');
4
+
5
+ function EmailSenderNode(config) {
6
+ RED.nodes.createNode(this, config);
7
+ var node = this;
8
+
9
+ node.on('input', function (msg, send, done) {
10
+ send =
11
+ send ||
12
+ function () {
13
+ node.send.apply(node, arguments);
14
+ };
15
+ done =
16
+ done ||
17
+ function (err) {
18
+ if (err) node.error(err, msg);
19
+ };
20
+
21
+ // Retrieve and evaluate mail configuration values
22
+ const sender = RED.util.evaluateNodeProperty(config.sender, config.senderType, node, msg);
23
+ const address = RED.util.evaluateNodeProperty(config.address, config.addressType, node, msg);
24
+ const to = RED.util.evaluateNodeProperty(config.to, config.toType, node, msg);
25
+ const cc = RED.util.evaluateNodeProperty(config.cc, config.ccType, node, msg) || '';
26
+ const bcc = RED.util.evaluateNodeProperty(config.bcc, config.bccType, node, msg) || '';
27
+ const replyTo = RED.util.evaluateNodeProperty(config.replyTo, config.replyToType, node, msg) || '';
28
+ const subject =
29
+ RED.util.evaluateNodeProperty(config.subject, config.subjectType, node, msg) ||
30
+ msg.topic ||
31
+ 'Message from Node-RED';
32
+ const htmlContent = RED.util.evaluateNodeProperty(config.htmlContent, config.htmlContentType, node, msg);
33
+ const attachments = safeEvaluatePropertyAttachment(config, node, msg);
34
+
35
+ // Retrieve and evaluate SMTP configuration values
36
+ const host = RED.util.evaluateNodeProperty(config.host, config.hostType, node, msg);
37
+ const port = RED.util.evaluateNodeProperty(config.port, config.portType, node, msg);
38
+ const user = RED.util.evaluateNodeProperty(config.user, config.userType, node, msg);
39
+ const password = RED.util.evaluateNodeProperty(config.password, config.passwordType, node, msg);
40
+ const secure = RED.util.evaluateNodeProperty(config.secure, config.secureType, node, msg);
41
+ const rejectUnauthorized = RED.util.evaluateNodeProperty(
42
+ config.rejectUnauthorized,
43
+ config.rejectUnauthorizedType,
44
+ node,
45
+ msg,
46
+ );
47
+
48
+ // Handle attachments and format them for Nodemailer
49
+ let processedAttachments = [];
50
+
51
+ let parsedAttachments = config.attachments;
52
+
53
+ if (config.attachmentsType === 'json' && typeof parsedAttachments === 'string') {
54
+ try {
55
+ parsedAttachments = JSON.parse(parsedAttachments);
56
+ } catch (e) {
57
+ node.error('Failed to parse attachments JSON: ' + e.message);
58
+ return;
59
+ }
60
+ }
61
+
62
+ if (parsedAttachments) {
63
+ // Check if it's a single attachment or an array
64
+ const attachmentArray = Array.isArray(parsedAttachments) ? parsedAttachments : [parsedAttachments];
65
+
66
+ for (const attachment of attachmentArray) {
67
+ try {
68
+ // Assuming the attachment object has a 'filename' and 'content' property
69
+ if (attachment.filename && attachment.content) {
70
+ processedAttachments.push({
71
+ filename: attachment.filename,
72
+ content: attachment.content,
73
+ });
74
+ } else {
75
+ node.status({ fill: 'red', shape: 'dot', text: 'attachment error' });
76
+ node.error("Attachment object is missing 'filename' or 'content' property.");
77
+ return;
78
+ }
79
+ } catch (e) {
80
+ node.error('Failed to process attachment: ' + e.message);
81
+ }
82
+ }
83
+ }
84
+
85
+ // Create SMTP transporter
86
+ const transporter = nodemailer.createTransport({
87
+ host: host,
88
+ port: port,
89
+ secure: secure,
90
+ auth: {
91
+ user: user,
92
+ pass: password,
93
+ },
94
+ tls: {
95
+ rejectUnauthorized: rejectUnauthorized,
96
+ },
97
+ });
98
+
99
+ // Create email object
100
+ const mailOptions = {
101
+ from: {
102
+ name: sender,
103
+ address: address,
104
+ },
105
+ to: to,
106
+ cc: cc,
107
+ bcc: bcc,
108
+ replyTo: replyTo,
109
+ subject: subject,
110
+ html: Buffer.from(htmlContent, 'utf-8'),
111
+ attachments: processedAttachments,
112
+ };
113
+
114
+ // Send email
115
+ transporter.sendMail(mailOptions, (error, info) => {
116
+ if (error) {
117
+ node.status({ fill: 'red', shape: 'dot', text: 'error sending' });
118
+ if (
119
+ error.message &&
120
+ error.message.includes('SSL routines') &&
121
+ error.message.includes('wrong version number')
122
+ ) {
123
+ // Improved error message for SSL/TLS issues
124
+ done(
125
+ new Error(
126
+ 'SSL/TLS connection failed: Wrong version number. ' +
127
+ 'This usually means the wrong port or security settings are used. ' +
128
+ 'For SMTP: use port 587 with secure=false (STARTTLS) or port 465 with secure=true (SSL/TLS).',
129
+ ),
130
+ );
131
+ } else {
132
+ done(error);
133
+ }
134
+ } else {
135
+ node.log('Email sent: ' + info.response);
136
+ msg.payload = info;
137
+
138
+ if (msg.payload.accepted && msg.payload.accepted.length > 0) {
139
+ msg.payload = msg.input;
140
+ node.status({ fill: 'green', shape: 'dot', text: 'sent' });
141
+ send(msg);
142
+ done();
143
+ } else if (msg.payload.rejected && msg.payload.rejected.length > 0) {
144
+ msg.error = { result: msg.payload.rejected };
145
+ node.status({ fill: 'red', shape: 'dot', text: 'rejected' });
146
+ done(new Error('Email rejected: ' + msg.payload.rejected.join(', ')));
147
+ } else if (msg.payload.pending && msg.payload.pending.length > 0) {
148
+ msg.error = { result: msg.payload.pending };
149
+ node.status({ fill: 'yellow', shape: 'dot', text: 'pending' });
150
+ done(new Error('Email pending: ' + msg.payload.pending.join(', ')));
151
+ } else {
152
+ node.status({ fill: 'red', shape: 'dot', text: 'unknown error' });
153
+ done(new Error('Unknown error while sending email.'));
154
+ }
155
+ }
156
+ });
157
+ });
158
+ }
159
+
160
+ RED.nodes.registerType('email-sender', EmailSenderNode);
161
+
162
+ function safeEvaluatePropertyAttachment(config, node, msg) {
163
+ if (config.attachments && config.attachments.trim() !== '') {
164
+ try {
165
+ return RED.util.evaluateNodeProperty(config.attachments, config.attachmentsType, node, msg);
166
+ } catch (e) {
167
+ node.error('Failed to evaluate attachments property: ' + e.message, msg);
168
+ return null;
169
+ }
170
+ }
171
+
172
+ return null;
173
+ }
174
+ };
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube-tools",
3
- "version": "1.0.1",
3
+ "version": "1.0.2-develop-e3d5d9-mfm8oea8",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED tools nodes for ProcessCube",
6
6
  "scripts": {
7
- "lint": "prettier --write --config ./.prettierrc.json \"**/*.{html,js}\""
7
+ "lint": "prettier --write --config ./.prettierrc.json \"**/*.{html,js}\"",
8
+ "test": "mocha test/unit/ test/integration"
8
9
  },
9
10
  "authors": [
10
11
  {
@@ -14,6 +15,10 @@
14
15
  {
15
16
  "name": "Robin Lenz",
16
17
  "email": "Robin.Lenz@5Minds.de"
18
+ },
19
+ {
20
+ "name": "Diana Stefan",
21
+ "email": "Diana.Stefan@5Minds.de"
17
22
  }
18
23
  ],
19
24
  "repository": {
@@ -31,12 +36,28 @@
31
36
  "node-red": {
32
37
  "version": ">=3.1.9",
33
38
  "nodes": {
34
- "HtmlToText": "processcube-html-to-text.js"
39
+ "EmailReceiver": "email-receiver/email-receiver.js",
40
+ "EmailSender": "email-sender/email-sender.js",
41
+ "HtmlToText": "processcube-html-to-text/processcube-html-to-text.js"
35
42
  },
36
43
  "examples": "examples"
37
44
  },
38
45
  "dependencies": {
39
- "html-to-text": "^9.0.5"
46
+ "html-to-text": "^9.0.5",
47
+ "mailparser": "^3.6.8",
48
+ "node-imap": "^0.9.6",
49
+ "nodemailer": "^7.0.6",
50
+ "utf7": "^1.0.2"
51
+ },
52
+ "devDependencies": {
53
+ "chai": "^4.3.4",
54
+ "mocha": "^11.7.2",
55
+ "node-red": "^4.0.9",
56
+ "node-red-node-test-helper": "^0.3.5"
57
+ },
58
+ "overrides": {
59
+ "semver": ">=7.5.2",
60
+ "axios": ">=1.12.0"
40
61
  },
41
62
  "keywords": [
42
63
  "node-red",
@@ -22,20 +22,20 @@
22
22
  </script>
23
23
 
24
24
  <script type="text/markdown" data-help-name="processcube-google-docs-mail-template">
25
- # Html 2 Text
25
+ # Html 2 Text
26
26
 
27
- ## Inputs
27
+ ## Inputs
28
28
 
29
- : payload (String) : html content to convert to text
29
+ : payload (String) : html content to convert to text
30
30
 
31
- ## Outputs
31
+ ## Outputs
32
32
 
33
- : payload (String) : text content
33
+ : payload (String) : text content
34
34
 
35
- ---
35
+ ---
36
36
 
37
- ## References
37
+ ## References
38
38
 
39
- - [The ProcessCube Developer Network](https://processcube.io) – All documentation for the ProcessCube&copy; platform
40
- - [Node-RED Integration in ProcessCube&copy;](https://processcube.io/docs/node-red) – Node-RED integration in ProcessCube&copy;
39
+ - [The ProcessCube Developer Network](https://processcube.io) – All documentation for the ProcessCube&copy; platform
40
+ - [Node-RED Integration in ProcessCube&copy;](https://processcube.io/docs/node-red) – Node-RED integration in ProcessCube&copy;
41
41
  </script>
@@ -1,5 +1,4 @@
1
1
  module.exports = function (RED) {
2
-
3
2
  const { compile } = require('html-to-text');
4
3
 
5
4
  function ProcesscubeHtmlToText(config) {
@@ -12,9 +11,7 @@ module.exports = function (RED) {
12
11
  };
13
12
  const compiledConvert = compile(options); // options passed here
14
13
 
15
-
16
14
  node.on('input', async function (msg) {
17
-
18
15
  msg.payload = compiledConvert(msg.payload);
19
16
 
20
17
  node.send(msg);