n8n-nodes-resend 3.2.0 → 3.2.1
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.
|
@@ -422,38 +422,40 @@ async function execute(index) {
|
|
|
422
422
|
});
|
|
423
423
|
if (additionalOptions.topicId) requestBody.topic_id = additionalOptions.topicId;
|
|
424
424
|
if (additionalOptions.scheduledAt) requestBody.scheduled_at = additionalOptions.scheduledAt;
|
|
425
|
-
if ((_additionalOptions$at = additionalOptions.attachments) === null || _additionalOptions$at === void 0 || (_additionalOptions$at = _additionalOptions$at.attachments) === null || _additionalOptions$at === void 0 ? void 0 : _additionalOptions$at.length)
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
filename,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
if (
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
425
|
+
if ((_additionalOptions$at = additionalOptions.attachments) === null || _additionalOptions$at === void 0 || (_additionalOptions$at = _additionalOptions$at.attachments) === null || _additionalOptions$at === void 0 ? void 0 : _additionalOptions$at.length) {
|
|
426
|
+
const attachments = [];
|
|
427
|
+
for (const attachment of additionalOptions.attachments.attachments) {
|
|
428
|
+
var _attachment$content_i, _attachment$content_t;
|
|
429
|
+
const contentId = (_attachment$content_i = attachment.content_id) !== null && _attachment$content_i !== void 0 ? _attachment$content_i : attachment.contentId;
|
|
430
|
+
const contentType = (_attachment$content_t = attachment.content_type) !== null && _attachment$content_t !== void 0 ? _attachment$content_t : attachment.contentType;
|
|
431
|
+
if (attachment.attachmentType === "binaryData") {
|
|
432
|
+
var _items$index$binary;
|
|
433
|
+
const binaryPropertyName = attachment.binaryPropertyName || "data";
|
|
434
|
+
const binaryData = (_items$index$binary = items[index].binary) === null || _items$index$binary === void 0 ? void 0 : _items$index$binary[binaryPropertyName];
|
|
435
|
+
if (!binaryData) throw new n8n_workflow.NodeOperationError(this.getNode(), `Binary property "${binaryPropertyName}" not found in item ${index}`, { itemIndex: index });
|
|
436
|
+
const filename = attachment.filename || binaryData.fileName;
|
|
437
|
+
if (!filename) throw new n8n_workflow.NodeOperationError(this.getNode(), "File Name is required for binary attachments.", { itemIndex: index });
|
|
438
|
+
const attachmentEntry = {
|
|
439
|
+
filename,
|
|
440
|
+
content: (await this.helpers.getBinaryDataBuffer(index, binaryPropertyName)).toString("base64")
|
|
441
|
+
};
|
|
442
|
+
if (contentId) attachmentEntry.content_id = contentId;
|
|
443
|
+
if (contentType) attachmentEntry.content_type = contentType;
|
|
444
|
+
attachments.push(attachmentEntry);
|
|
445
|
+
} else if (attachment.attachmentType === "url") {
|
|
446
|
+
if (!attachment.filename) throw new n8n_workflow.NodeOperationError(this.getNode(), "File Name is required for URL attachments.", { itemIndex: index });
|
|
447
|
+
if (!attachment.fileUrl) throw new n8n_workflow.NodeOperationError(this.getNode(), "File URL is required for URL attachments.", { itemIndex: index });
|
|
448
|
+
const attachmentEntry = {
|
|
449
|
+
filename: attachment.filename,
|
|
450
|
+
path: attachment.fileUrl
|
|
451
|
+
};
|
|
452
|
+
if (contentId) attachmentEntry.content_id = contentId;
|
|
453
|
+
if (contentType) attachmentEntry.content_type = contentType;
|
|
454
|
+
attachments.push(attachmentEntry);
|
|
455
|
+
}
|
|
454
456
|
}
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
+
requestBody.attachments = attachments;
|
|
458
|
+
}
|
|
457
459
|
const requestHeaders = { "Content-Type": "application/json" };
|
|
458
460
|
if (additionalOptions.idempotencyKey) requestHeaders["Idempotency-Key"] = additionalOptions.idempotencyKey;
|
|
459
461
|
let response;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-resend",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Resend integration for n8n: Email, Broadcasts, Templates, Domains, Contacts, Segments, Topics, Webhooks, Automations, Events, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|