n8n-nodes-gmail-custom 0.1.4 → 0.1.6
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.
|
@@ -393,14 +393,22 @@ class GmailCustom {
|
|
|
393
393
|
let attachments = [];
|
|
394
394
|
if (options.attachmentsUi && options.attachmentsUi.attachmentsBinary) {
|
|
395
395
|
for (const { property } of options.attachmentsUi.attachmentsBinary) {
|
|
396
|
+
if (!property) continue;
|
|
396
397
|
for (const name of property.split(',')) {
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
398
|
+
const trimmedName = name.trim();
|
|
399
|
+
if (!trimmedName) continue;
|
|
400
|
+
const binaryMeta = item.binary && item.binary[trimmedName];
|
|
401
|
+
if (!binaryMeta) continue;
|
|
402
|
+
try {
|
|
403
|
+
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, trimmedName);
|
|
404
|
+
attachments.push({
|
|
405
|
+
fileName: binaryMeta.fileName || 'attachment',
|
|
406
|
+
mimeType: binaryMeta.mimeType || 'application/octet-stream',
|
|
407
|
+
content: binaryDataBuffer,
|
|
408
|
+
});
|
|
409
|
+
} catch (e) {
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
404
412
|
}
|
|
405
413
|
}
|
|
406
414
|
}
|
|
@@ -471,4 +479,5 @@ class GmailCustom {
|
|
|
471
479
|
|
|
472
480
|
module.exports = {
|
|
473
481
|
nodeTypes: [GmailCustom],
|
|
482
|
+
GmailCustom,
|
|
474
483
|
};
|