n8n-nodes-digit 0.1.17 → 0.1.18
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/dist/nodes/DIGIT.node.js +38 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/nodes/DIGIT.node.js
CHANGED
|
@@ -188,6 +188,44 @@ class DIGIT {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
// ==================================================
|
|
191
|
+
// NOTIFICATION — SEND EMAIL
|
|
192
|
+
// ==================================================
|
|
193
|
+
if (resource === 'notification') {
|
|
194
|
+
const operation = this.getNodeParameter('notificationOperation', 0);
|
|
195
|
+
if (operation === 'notification_send_email') {
|
|
196
|
+
for (let i = 0; i < items.length; i++) {
|
|
197
|
+
const tenantId = this.getNodeParameter('tenantId', i);
|
|
198
|
+
const accessToken = this.getNodeParameter('accessToken', i);
|
|
199
|
+
const cleanToken = accessToken.replace(/^Bearer\s+/i, '').trim();
|
|
200
|
+
let body;
|
|
201
|
+
try {
|
|
202
|
+
body = JSON.parse(this.getNodeParameter('requestBody', i));
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
throw new Error('Invalid JSON in Request Body');
|
|
206
|
+
}
|
|
207
|
+
// Gateway compatible path
|
|
208
|
+
const notificationPath = '/notification/v1/email/send';
|
|
209
|
+
const apiResponse = await this.helpers.httpRequest({
|
|
210
|
+
method: 'POST',
|
|
211
|
+
url: new URL(notificationPath, baseUrl).toString(),
|
|
212
|
+
headers: {
|
|
213
|
+
'X-Tenant-ID': tenantId,
|
|
214
|
+
Authorization: `Bearer ${cleanToken}`,
|
|
215
|
+
'Content-Type': 'application/json',
|
|
216
|
+
},
|
|
217
|
+
body,
|
|
218
|
+
json: true,
|
|
219
|
+
});
|
|
220
|
+
// Prevent circular reference crash
|
|
221
|
+
returnData.push({
|
|
222
|
+
json: JSON.parse(JSON.stringify(apiResponse)),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return [returnData];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
// ==================================================
|
|
191
229
|
// IDGEN — GENERATE
|
|
192
230
|
// ==================================================
|
|
193
231
|
if (resource === 'idgen') {
|
package/dist/package.json
CHANGED