From 3a09da92be556df1b840c0e16e020b0618ce7643 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Mon, 30 May 2022 13:23:57 +0300 Subject: [PATCH] fix(Gmail Node): Fix sending attachments when filesystem mode is used (#3396) --- packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts b/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts index a02b2d9b530da..9bb2e36fc03fb 100644 --- a/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts @@ -336,9 +336,10 @@ export class Gmail implements INodeType { for (const binaryProperty of (property as string).split(',')) { if (items[i].binary![binaryProperty] !== undefined) { const binaryData = items[i].binary![binaryProperty]; + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty); attachmentsBinary.push({ name: binaryData.fileName || 'unknown', - content: binaryData.data, + content: binaryDataBuffer, type: binaryData.mimeType, }); } @@ -422,9 +423,10 @@ export class Gmail implements INodeType { for (const binaryProperty of (property as string).split(',')) { if (items[i].binary![binaryProperty] !== undefined) { const binaryData = items[i].binary![binaryProperty]; + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty); attachmentsBinary.push({ name: binaryData.fileName || 'unknown', - content: binaryData.data, + content: binaryDataBuffer, type: binaryData.mimeType, }); } @@ -644,9 +646,10 @@ export class Gmail implements INodeType { for (const binaryProperty of (property as string).split(',')) { if (items[i].binary![binaryProperty] !== undefined) { const binaryData = items[i].binary![binaryProperty]; + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty); attachmentsBinary.push({ name: binaryData.fileName || 'unknown', - content: binaryData.data, + content: binaryDataBuffer, type: binaryData.mimeType, }); }