@5minds/node-red-contrib-processcube-tools 1.0.1-feature-434c91-mffah0hd → 1.0.1-feature-c82263-mffckkf9
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-receiver/email-receiver.html +187 -0
- package/email-receiver/email-receiver.js +236 -0
- package/package.json +23 -5
- package/test/helpers/email-receiver.mocks.js +452 -0
- package/test/integration/email-receiver.integration.test.js +524 -0
- package/test/unit/email-receiver.unit.test.js +309 -0
- package/.env.template +0 -4
- package/email-sender/email-sender.html +0 -257
- package/email-sender/email-sender.js +0 -114
- /package/{processcube-html-to-text/processcube-html-to-text.html → processcube-html-to-text.html} +0 -0
- /package/{processcube-html-to-text/processcube-html-to-text.js → processcube-html-to-text.js} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
const should = require('should');
|
|
2
|
+
const {
|
|
3
|
+
createMockNodeRED,
|
|
4
|
+
setupModuleMocks,
|
|
5
|
+
testConfigs,
|
|
6
|
+
testUtils
|
|
7
|
+
} = require('../helpers/email-receiver.mocks.js');
|
|
8
|
+
|
|
9
|
+
describe('Email Receiver Node - Unit Tests with Helpers', function() {
|
|
10
|
+
this.timeout(10000);
|
|
11
|
+
|
|
12
|
+
let emailReceiverNode;
|
|
13
|
+
let cleanupMocks;
|
|
14
|
+
|
|
15
|
+
before(function() {
|
|
16
|
+
// Set up module mocks using helper
|
|
17
|
+
cleanupMocks = setupModuleMocks();
|
|
18
|
+
|
|
19
|
+
// Load the node with mocked dependencies
|
|
20
|
+
emailReceiverNode = require('../../email-receiver/email-receiver.js');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
after(function() {
|
|
24
|
+
// Clean up mocks
|
|
25
|
+
if (cleanupMocks) {
|
|
26
|
+
cleanupMocks();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe('Module Export', function() {
|
|
31
|
+
it('should export a function', function() {
|
|
32
|
+
emailReceiverNode.should.be.type('function');
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('Node Registration', function() {
|
|
37
|
+
it('should register node type without errors', function() {
|
|
38
|
+
// ARRANGE: Create mock Node-RED with tracking
|
|
39
|
+
const mockRED = createMockNodeRED();
|
|
40
|
+
|
|
41
|
+
// ACT: Register the node
|
|
42
|
+
emailReceiverNode(mockRED);
|
|
43
|
+
|
|
44
|
+
// ASSERT: Verify registration
|
|
45
|
+
mockRED.nodes.lastRegisteredType.should.equal('email-receiver');
|
|
46
|
+
mockRED.nodes.lastRegisteredConstructor.should.be.type('function');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('Node Instantiation', function() {
|
|
51
|
+
it('should handle node instantiation with valid config', function() {
|
|
52
|
+
// ARRANGE: Track node creation
|
|
53
|
+
let createdNode = null;
|
|
54
|
+
const mockRED = createMockNodeRED({
|
|
55
|
+
onHandler: function(event, callback) {
|
|
56
|
+
createdNode = this;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// ACT: Register and create node instance
|
|
61
|
+
emailReceiverNode(mockRED);
|
|
62
|
+
new mockRED.nodes.lastRegisteredConstructor(testConfigs.valid);
|
|
63
|
+
|
|
64
|
+
// ASSERT: Verify node was created with correct properties
|
|
65
|
+
should.exist(createdNode);
|
|
66
|
+
createdNode.should.have.property('name', testConfigs.valid.name);
|
|
67
|
+
createdNode.should.have.property('id', testConfigs.valid.id);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should handle minimal config', function() {
|
|
71
|
+
// ARRANGE: Use minimal test config
|
|
72
|
+
let createdNode = null;
|
|
73
|
+
const mockRED = createMockNodeRED({
|
|
74
|
+
onHandler: function(event, callback) {
|
|
75
|
+
createdNode = this;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// ACT: Register and create node with minimal config
|
|
80
|
+
emailReceiverNode(mockRED);
|
|
81
|
+
new mockRED.nodes.lastRegisteredConstructor(testConfigs.minimal);
|
|
82
|
+
|
|
83
|
+
// ASSERT: Verify node creation
|
|
84
|
+
should.exist(createdNode);
|
|
85
|
+
createdNode.should.have.property('id', testConfigs.minimal.id);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('Folder Configuration', function() {
|
|
90
|
+
it('should handle array of folders', async function() {
|
|
91
|
+
// ARRANGE: Set up message tracking
|
|
92
|
+
let sentMessage = null;
|
|
93
|
+
const mockRED = createMockNodeRED({
|
|
94
|
+
sendHandler: function(msg) {
|
|
95
|
+
sentMessage = msg;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// ACT: Register node and create instance with array folders
|
|
100
|
+
emailReceiverNode(mockRED);
|
|
101
|
+
const nodeConstructor = mockRED.nodes.lastRegisteredConstructor;
|
|
102
|
+
const nodeInstance = new nodeConstructor(testConfigs.arrayFolders);
|
|
103
|
+
|
|
104
|
+
// Wait for processing
|
|
105
|
+
await testUtils.wait(50);
|
|
106
|
+
|
|
107
|
+
// ASSERT: Should handle array folders without error
|
|
108
|
+
should.exist(nodeInstance);
|
|
109
|
+
nodeInstance.should.have.property('name', testConfigs.arrayFolders.name);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
describe('Error Handling', function() {
|
|
114
|
+
it('should call node.error for invalid folder type', function(done) {
|
|
115
|
+
// ARRANGE: Set up error tracking
|
|
116
|
+
const mockRED = createMockNodeRED({
|
|
117
|
+
onHandler: function(event, callback) {
|
|
118
|
+
if (event === 'input') {
|
|
119
|
+
this.inputCallback = callback;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
errorHandler: function(err) {
|
|
123
|
+
// ASSERT: Should receive appropriate error message
|
|
124
|
+
err.should.containEql("The 'folders' property must be an array of strings.");
|
|
125
|
+
done();
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// ACT: Register node and create instance with invalid config
|
|
130
|
+
emailReceiverNode(mockRED);
|
|
131
|
+
const nodeConstructor = mockRED.nodes.lastRegisteredConstructor;
|
|
132
|
+
const nodeInstance = new nodeConstructor(testConfigs.invalidFolderType);
|
|
133
|
+
|
|
134
|
+
// Trigger the error by sending an input message
|
|
135
|
+
// Use a small delay to ensure the constructor has completed
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
if (nodeInstance.inputCallback) {
|
|
138
|
+
nodeInstance.inputCallback({ payload: "test" });
|
|
139
|
+
} else {
|
|
140
|
+
done(new Error('inputCallback was not set on the node instance'));
|
|
141
|
+
}
|
|
142
|
+
}, 10);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('should call node.error for missing config', function(done) {
|
|
146
|
+
// ARRANGE: Set up error and status tracking
|
|
147
|
+
let statusCalled = false;
|
|
148
|
+
const mockRED = createMockNodeRED({
|
|
149
|
+
onHandler: function(event, callback) {
|
|
150
|
+
if (event === 'input') {
|
|
151
|
+
this.inputCallback = callback;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
statusHandler: function(status) {
|
|
155
|
+
statusCalled = true;
|
|
156
|
+
if (status.fill) {
|
|
157
|
+
status.fill.should.equal('red');
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
errorHandler: function(err) {
|
|
161
|
+
// ASSERT: Should receive config error
|
|
162
|
+
err.should.containEql('Missing required IMAP config');
|
|
163
|
+
statusCalled.should.be.true();
|
|
164
|
+
done();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// ACT: Register node and create instance with invalid config
|
|
169
|
+
emailReceiverNode(mockRED);
|
|
170
|
+
const nodeConstructor = mockRED.nodes.lastRegisteredConstructor;
|
|
171
|
+
const nodeInstance = new nodeConstructor(testConfigs.invalidConfig);
|
|
172
|
+
|
|
173
|
+
// Trigger the error by sending an input message
|
|
174
|
+
// Use a small delay to ensure the constructor has completed
|
|
175
|
+
setTimeout(() => {
|
|
176
|
+
if (nodeInstance.inputCallback) {
|
|
177
|
+
nodeInstance.inputCallback({ payload: "test" });
|
|
178
|
+
} else {
|
|
179
|
+
done(new Error('inputCallback was not set on the node instance'));
|
|
180
|
+
}
|
|
181
|
+
}, 10);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('should handle connection errors gracefully', function(done) {
|
|
185
|
+
// ARRANGE: Set up connection error scenario with done() protection
|
|
186
|
+
let testCompleted = false;
|
|
187
|
+
|
|
188
|
+
const completeDone = () => {
|
|
189
|
+
if (!testCompleted) {
|
|
190
|
+
testCompleted = true;
|
|
191
|
+
done();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const mockRED = createMockNodeRED({
|
|
196
|
+
onHandler: function(event, callback) {
|
|
197
|
+
if (event === 'input') {
|
|
198
|
+
this.inputCallback = callback;
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
statusHandler: function(status) {
|
|
202
|
+
if (status.fill === 'red' && status.text && status.text.includes('error')) {
|
|
203
|
+
completeDone(); // Success - error status was set
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
errorHandler: function(err) {
|
|
207
|
+
// Also accept errors as valid completion
|
|
208
|
+
should.exist(err);
|
|
209
|
+
completeDone();
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// Use a config that should cause connection issues
|
|
214
|
+
const badConfig = {
|
|
215
|
+
...testConfigs.valid,
|
|
216
|
+
host: 'nonexistent.invalid.host.com',
|
|
217
|
+
port: 12345 // Invalid port
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// ACT: Register node and create instance with invalid config
|
|
221
|
+
emailReceiverNode(mockRED);
|
|
222
|
+
const nodeConstructor = mockRED.nodes.lastRegisteredConstructor;
|
|
223
|
+
const nodeInstance = new nodeConstructor(badConfig);
|
|
224
|
+
|
|
225
|
+
// Trigger the error by sending an input message
|
|
226
|
+
// Use a small delay to ensure the constructor has completed
|
|
227
|
+
setTimeout(() => {
|
|
228
|
+
if (nodeInstance.inputCallback) {
|
|
229
|
+
nodeInstance.inputCallback({ payload: "test" });
|
|
230
|
+
} else {
|
|
231
|
+
completeDone(new Error('inputCallback was not set on the node instance'));
|
|
232
|
+
}
|
|
233
|
+
}, 10);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
describe('IMAP Connection', function() {
|
|
238
|
+
it('should handle connection success', function(done) {
|
|
239
|
+
// ARRANGE: Set up connection tracking
|
|
240
|
+
const mockRED = createMockNodeRED({
|
|
241
|
+
onHandler: function(event, callback) {
|
|
242
|
+
if (event === 'input') {
|
|
243
|
+
this.inputCallback = callback;
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
statusHandler: function(status) {
|
|
247
|
+
// ASSERT: Check for 'connected' status and then complete the test
|
|
248
|
+
if (status.fill === 'green' && status.text === 'connected') {
|
|
249
|
+
done();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
// ACT: Create node with config that should fail
|
|
255
|
+
emailReceiverNode(mockRED);
|
|
256
|
+
const nodeConstructor = mockRED.nodes.lastRegisteredConstructor;
|
|
257
|
+
const nodeInstance = new nodeConstructor(testConfigs.valid);
|
|
258
|
+
|
|
259
|
+
// Trigger the connection attempt by sending an input message
|
|
260
|
+
setTimeout(() => {
|
|
261
|
+
if (nodeInstance.inputCallback) {
|
|
262
|
+
nodeInstance.inputCallback({ payload: "test" });
|
|
263
|
+
} else {
|
|
264
|
+
done(new Error('inputCallback was not set on the node instance'));
|
|
265
|
+
}
|
|
266
|
+
}, 10);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it('should handle connection errors', function(done) {
|
|
270
|
+
// ARRANGE: Set up error tracking
|
|
271
|
+
const mockRED = createMockNodeRED({
|
|
272
|
+
onHandler: function(event, callback) {
|
|
273
|
+
if (event === 'input') {
|
|
274
|
+
// Store the callback on the node instance
|
|
275
|
+
this.inputCallback = callback;
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
errorHandler: function(err) {
|
|
279
|
+
// ASSERT: Should handle connection errors gracefully
|
|
280
|
+
should.exist(err);
|
|
281
|
+
done();
|
|
282
|
+
},
|
|
283
|
+
statusHandler: function(status) {
|
|
284
|
+
if (status.fill === 'red') {
|
|
285
|
+
// Connection failed status
|
|
286
|
+
status.text.should.containEql('error');
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// ACT: Create node with config that should fail
|
|
292
|
+
emailReceiverNode(mockRED);
|
|
293
|
+
const nodeConstructor = mockRED.nodes.lastRegisteredConstructor;
|
|
294
|
+
|
|
295
|
+
// Use invalid config to trigger connection error
|
|
296
|
+
const invalidConfig = { ...testConfigs.valid, host: 'invalid.host.com' };
|
|
297
|
+
const nodeInstance = new nodeConstructor(invalidConfig);
|
|
298
|
+
|
|
299
|
+
// Trigger the connection attempt by sending an input message
|
|
300
|
+
setTimeout(() => {
|
|
301
|
+
if (nodeInstance.inputCallback) {
|
|
302
|
+
nodeInstance.inputCallback({ payload: "test" });
|
|
303
|
+
} else {
|
|
304
|
+
done(new Error('inputCallback was not set on the node instance'));
|
|
305
|
+
}
|
|
306
|
+
}, 10);
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
});
|
package/.env.template
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
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: { value: "Stoelting Ticket-System", required: true, validate: RED.validators.typedInput("senderType") },
|
|
9
|
-
senderType: { value: "str" },
|
|
10
|
-
address: { value: "", required: true, validate: RED.validators.typedInput("addressType") },
|
|
11
|
-
addressType: { value: "str" },
|
|
12
|
-
to: { value: "", required: true, validate: RED.validators.typedInput("toType") },
|
|
13
|
-
toType: { value: "str" },
|
|
14
|
-
cc: { value: "", validate: RED.validators.typedInput("ccType") },
|
|
15
|
-
ccType: { value: "str" },
|
|
16
|
-
bcc: { value: "", validate: RED.validators.typedInput("bccType") },
|
|
17
|
-
bccType: { value: "str" },
|
|
18
|
-
subject: { value: "", required: true, validate: RED.validators.typedInput("subjectType") },
|
|
19
|
-
subjectType: { value: "str" },
|
|
20
|
-
attachments: { value: "", validate: RED.validators.typedInput("attachmentsType") },
|
|
21
|
-
attachmentsType: { value: "msg" },
|
|
22
|
-
htmlContent: { value: "", required: true, validate: RED.validators.typedInput("htmlContentType") },
|
|
23
|
-
htmlContentType: { value: "str" },
|
|
24
|
-
|
|
25
|
-
// SMTP-Fields
|
|
26
|
-
host: { value: "", required: true, validate: RED.validators.typedInput("hostType") },
|
|
27
|
-
hostType: { value: "str" },
|
|
28
|
-
port: { value: "", required: true, validate: RED.validators.typedInput("portType") },
|
|
29
|
-
portType: { value: "num" },
|
|
30
|
-
user: { value: "", required: true, validate: RED.validators.typedInput("userType") },
|
|
31
|
-
userType: { value: "str" },
|
|
32
|
-
password: { value: "", required: true, type: "password" },
|
|
33
|
-
passwordType: { value: "env", required: true },
|
|
34
|
-
secure: { value: "", required: true, validate: RED.validators.typedInput("secureType") },
|
|
35
|
-
secureType: { value: "bool" },
|
|
36
|
-
rejectUnauthorized: { value: "", required: true, validate: RED.validators.typedInput("rejectUnauthorizedType") },
|
|
37
|
-
rejectUnauthorizedType: { value: "bool" }
|
|
38
|
-
},
|
|
39
|
-
inputs: 1,
|
|
40
|
-
outputs: 1,
|
|
41
|
-
icon: "font-awesome/fa-paper-plane",
|
|
42
|
-
label: function() {
|
|
43
|
-
return this.name || "Email Sender";
|
|
44
|
-
},
|
|
45
|
-
oneditprepare: function() {
|
|
46
|
-
// Mail Fields
|
|
47
|
-
$('#node-input-sender').typedInput({
|
|
48
|
-
default: 'str',
|
|
49
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
50
|
-
typeField: '#node-input-senderType'
|
|
51
|
-
});
|
|
52
|
-
$('#node-input-address').typedInput({
|
|
53
|
-
default: 'str',
|
|
54
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
55
|
-
typeField: '#node-input-addressType'
|
|
56
|
-
});
|
|
57
|
-
$('#node-input-to').typedInput({
|
|
58
|
-
default: 'str',
|
|
59
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
60
|
-
typeField: '#node-input-toType'
|
|
61
|
-
});
|
|
62
|
-
$('#node-input-cc').typedInput({
|
|
63
|
-
default: 'str',
|
|
64
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
65
|
-
typeField: '#node-input-ccType'
|
|
66
|
-
});
|
|
67
|
-
$('#node-input-bcc').typedInput({
|
|
68
|
-
default: 'str',
|
|
69
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
70
|
-
typeField: '#node-input-bccType'
|
|
71
|
-
});
|
|
72
|
-
$('#node-input-subject').typedInput({
|
|
73
|
-
default: 'str',
|
|
74
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
75
|
-
typeField: '#node-input-subjectType'
|
|
76
|
-
});
|
|
77
|
-
$('#node-input-attachments').typedInput({
|
|
78
|
-
default: 'msg',
|
|
79
|
-
types: ['msg', 'flow', 'global'],
|
|
80
|
-
typeField: '#node-input-attachmentsType'
|
|
81
|
-
});
|
|
82
|
-
$('#node-input-htmlContent').typedInput({
|
|
83
|
-
default: 'str',
|
|
84
|
-
types: ['str', 'msg', 'flow', 'global', 'json'],
|
|
85
|
-
typeField: '#node-input-htmlContentType'
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// SMTP Fields
|
|
89
|
-
$('#node-input-host').typedInput({
|
|
90
|
-
default: 'str',
|
|
91
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
92
|
-
typeField: '#node-input-hostType'
|
|
93
|
-
});
|
|
94
|
-
$('#node-input-port').typedInput({
|
|
95
|
-
default: 'num',
|
|
96
|
-
types: ['num', 'msg', 'flow', 'global', 'env'],
|
|
97
|
-
typeField: '#node-input-portType'
|
|
98
|
-
});
|
|
99
|
-
$('#node-input-user').typedInput({
|
|
100
|
-
default: 'str',
|
|
101
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
102
|
-
typeField: '#node-input-userType'
|
|
103
|
-
});
|
|
104
|
-
$('#node-input-password').typedInput({
|
|
105
|
-
default: 'env',
|
|
106
|
-
types: ['msg', 'flow', 'global', 'env'],
|
|
107
|
-
typeField: '#node-input-passwordType'
|
|
108
|
-
});
|
|
109
|
-
$('#node-input-secure').typedInput({
|
|
110
|
-
default: 'bool',
|
|
111
|
-
types: ['bool', 'msg', 'flow', 'global', 'env'],
|
|
112
|
-
typeField: '#node-input-secureType'
|
|
113
|
-
});
|
|
114
|
-
$('#node-input-rejectUnauthorized').typedInput({
|
|
115
|
-
default: 'bool',
|
|
116
|
-
types: ['bool', 'msg', 'flow', 'global', 'env'],
|
|
117
|
-
typeField: '#node-input-rejectUnauthorizedType'
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
</script>
|
|
122
|
-
|
|
123
|
-
<script type="text/html" data-template-name="email-sender">
|
|
124
|
-
<div class="form-row">
|
|
125
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
126
|
-
<input type="text" id="node-input-name" placeholder="Name">
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<h3>Mail Configuration</h3>
|
|
130
|
-
<div class="form-row">
|
|
131
|
-
<label for="node-input-sender"><i class="fa fa-user"></i> Sender</label>
|
|
132
|
-
<input type="text" id="node-input-sender" placeholder="John Doe">
|
|
133
|
-
<input type="hidden" id="node-input-senderType">
|
|
134
|
-
</div>
|
|
135
|
-
<div class="form-row">
|
|
136
|
-
<label for="node-input-address"><i class="fa fa-envelope"></i> Address</label>
|
|
137
|
-
<input type="text" id="node-input-address" placeholder="john.doe@example.com">
|
|
138
|
-
<input type="hidden" id="node-input-addressType">
|
|
139
|
-
</div>
|
|
140
|
-
<div class="form-row">
|
|
141
|
-
<label for="node-input-to"><i class="fa fa-user"></i> To</label>
|
|
142
|
-
<input type="text" id="node-input-to" placeholder="my.test@example.com">
|
|
143
|
-
<input type="hidden" id="node-input-toType">
|
|
144
|
-
</div>
|
|
145
|
-
<div class="form-row">
|
|
146
|
-
<label for="node-input-cc"><i class="fa fa-user-plus"></i> CC</label>
|
|
147
|
-
<input type="text" id="node-input-cc">
|
|
148
|
-
<input type="hidden" id="node-input-ccType">
|
|
149
|
-
</div>
|
|
150
|
-
<div class="form-row">
|
|
151
|
-
<label for="node-input-bcc"><i class="fa fa-user-secret"></i> BCC</label>
|
|
152
|
-
<input type="text" id="node-input-bcc">
|
|
153
|
-
<input type="hidden" id="node-input-bccType">
|
|
154
|
-
</div>
|
|
155
|
-
<div class="form-row">
|
|
156
|
-
<label for="node-input-subject"><i class="fa fa-info-circle"></i> Subject</label>
|
|
157
|
-
<input type="text" id="node-input-subject">
|
|
158
|
-
<input type="hidden" id="node-input-subjectType">
|
|
159
|
-
</div>
|
|
160
|
-
<div class="form-row">
|
|
161
|
-
<label for="node-input-attachments"><i class="fa fa-paperclip"></i> Attachments</label>
|
|
162
|
-
<input type="text" id="node-input-attachments">
|
|
163
|
-
<input type="hidden" id="node-input-attachmentsType">
|
|
164
|
-
</div>
|
|
165
|
-
<div class="form-row">
|
|
166
|
-
<label for="node-input-htmlContent"><i class="fa fa-file-code-o"></i> HTML Content</label>
|
|
167
|
-
<input type="text" id="node-input-htmlContent">
|
|
168
|
-
<input type="hidden" id="node-input-htmlContentType">
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<h3>SMTP Configuration</h3>
|
|
172
|
-
<div class="form-row">
|
|
173
|
-
<label for="node-input-host"><i class="fa fa-server"></i> Host</label>
|
|
174
|
-
<input type="text" id="node-input-host" placeholder="smtp.gmail.com">
|
|
175
|
-
<input type="hidden" id="node-input-hostType">
|
|
176
|
-
</div>
|
|
177
|
-
<div class="form-row">
|
|
178
|
-
<label for="node-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
179
|
-
<input type="text" id="node-input-port" placeholder="587">
|
|
180
|
-
<input type="hidden" id="node-input-portType">
|
|
181
|
-
</div>
|
|
182
|
-
<div class="form-row">
|
|
183
|
-
<label for="node-input-user"><i class="fa fa-user"></i> User</label>
|
|
184
|
-
<input type="text" id="node-input-user" placeholder="test.user@config.com">
|
|
185
|
-
<input type="hidden" id="node-input-userType">
|
|
186
|
-
</div>
|
|
187
|
-
<div class="form-row">
|
|
188
|
-
<label for="node-input-password"><i class="fa fa-lock"></i> Password</label>
|
|
189
|
-
<input type="password" id="node-input-password">
|
|
190
|
-
<input type="hidden" id="node-input-passwordType">
|
|
191
|
-
</div>
|
|
192
|
-
<div class="form-row">
|
|
193
|
-
<label for="node-input-secure"><i class="fa fa-shield"></i> SSL/TLS (Secure)</label>
|
|
194
|
-
<input type="text" id="node-input-secure">
|
|
195
|
-
<input type="hidden" id="node-input-secureType">
|
|
196
|
-
</div>
|
|
197
|
-
<div class="form-row">
|
|
198
|
-
<label for="node-input-rejectUnauthorized"><i class="fa fa-ban"></i> Reject Unauthorized</label>
|
|
199
|
-
<input type="text" id="node-input-rejectUnauthorized">
|
|
200
|
-
<input type="hidden" id="node-input-rejectUnauthorizedType">
|
|
201
|
-
</div>
|
|
202
|
-
</script>
|
|
203
|
-
|
|
204
|
-
<script type="text/html" data-help-name="email-sender">
|
|
205
|
-
<p>A custom node to send emails using an SMTP server. The configuration for each field can be sourced from a fixed value, or from a <code>msg</code>, <code>flow</code>, <code>global</code>, or <code>env</code> variable.</p>
|
|
206
|
-
|
|
207
|
-
<h3>Configuration</h3>
|
|
208
|
-
<p>Every field on the configuration panel is a <b>typed input</b>. Use the dropdown menu next to each field to select the source of its value. Note that <b>Sender</b>, <b>Address</b>, <b>To</b>, <b>Subject</b>, and <b>HTML Content</b> are required fields and must be configured before the node can be deployed.</p>
|
|
209
|
-
|
|
210
|
-
<h4>Mail Configuration</h4>
|
|
211
|
-
<dl class="message-properties">
|
|
212
|
-
<dt>Sender <span class="property-type">string | variable</span></dt>
|
|
213
|
-
<dd>The name of the sender, as displayed to the recipient.</dd>
|
|
214
|
-
|
|
215
|
-
<dt>Address <span class="property-type">string | variable</span></dt>
|
|
216
|
-
<dd>The sender's email address.</dd>
|
|
217
|
-
|
|
218
|
-
<dt>To <span class="property-type">string | variable</span></dt>
|
|
219
|
-
<dd>The primary recipient's email address. Separate multiple addresses with a comma.</dd>
|
|
220
|
-
|
|
221
|
-
<dt>CC <span class="property-type">string | variable</span></dt>
|
|
222
|
-
<dd>Addresses to be carbon-copied on the email.</dd>
|
|
223
|
-
|
|
224
|
-
<dt>BCC <span class="property-type">string | variable</span></dt>
|
|
225
|
-
<dd>Addresses to be blind-carbon-copied on the email.</dd>
|
|
226
|
-
|
|
227
|
-
<dt>Subject <span class="property-type">string | variable</span></dt>
|
|
228
|
-
<dd>The subject line of the email.</dd>
|
|
229
|
-
|
|
230
|
-
<dt>Attachments <span class="property-type">array | variable</span></dt>
|
|
231
|
-
<dd>A list of file attachments. This should be a variable containing an array of attachment objects.</dd>
|
|
232
|
-
|
|
233
|
-
<dt>HTML Content <span class="property-type">string | variable</span></dt>
|
|
234
|
-
<dd>The HTML body of the email.</dd>
|
|
235
|
-
</dl>
|
|
236
|
-
|
|
237
|
-
<h4>SMTP Configuration</h4>
|
|
238
|
-
<dl class="message-properties">
|
|
239
|
-
<dt>Host <span class="property-type">string | variable</span></dt>
|
|
240
|
-
<dd>The hostname or IP address of the SMTP server.</dd>
|
|
241
|
-
|
|
242
|
-
<dt>Port <span class="property-type">number | variable</span></dt>
|
|
243
|
-
<dd>The port number of the SMTP server.</dd>
|
|
244
|
-
|
|
245
|
-
<dt>User <span class="property-type">string | variable</span></dt>
|
|
246
|
-
<dd>The username for SMTP authentication.</dd>
|
|
247
|
-
|
|
248
|
-
<dt>Password <span class="property-type">string | variable</span></dt>
|
|
249
|
-
<dd>The password for SMTP authentication.</dd>
|
|
250
|
-
|
|
251
|
-
<dt>SSL/TLS (Secure) <span class="property-type">boolean | variable</span></dt>
|
|
252
|
-
<dd>Use a secure connection. Set to <code>true</code> for SSL/TLS, <code>false</code> for a non-secure connection.</dd>
|
|
253
|
-
|
|
254
|
-
<dt>Reject Unauthorized <span class="property-type">boolean | variable</span></dt>
|
|
255
|
-
<dd>If <code>true</code>, the server's certificate is rejected if it's not authorized by a trusted CA.</dd>
|
|
256
|
-
</dl>
|
|
257
|
-
</script>
|