fix(Gmail Node): Fix sending attachments when filesystem mode is used (#3396)

This commit is contained in:
Michael Kret 2022-05-30 13:23:57 +03:00 committed by GitHub
parent b851289001
commit 3a09da92be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -336,9 +336,10 @@ export class Gmail implements INodeType {
for (const binaryProperty of (property as string).split(',')) { for (const binaryProperty of (property as string).split(',')) {
if (items[i].binary![binaryProperty] !== undefined) { if (items[i].binary![binaryProperty] !== undefined) {
const binaryData = items[i].binary![binaryProperty]; const binaryData = items[i].binary![binaryProperty];
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
attachmentsBinary.push({ attachmentsBinary.push({
name: binaryData.fileName || 'unknown', name: binaryData.fileName || 'unknown',
content: binaryData.data, content: binaryDataBuffer,
type: binaryData.mimeType, type: binaryData.mimeType,
}); });
} }
@ -422,9 +423,10 @@ export class Gmail implements INodeType {
for (const binaryProperty of (property as string).split(',')) { for (const binaryProperty of (property as string).split(',')) {
if (items[i].binary![binaryProperty] !== undefined) { if (items[i].binary![binaryProperty] !== undefined) {
const binaryData = items[i].binary![binaryProperty]; const binaryData = items[i].binary![binaryProperty];
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
attachmentsBinary.push({ attachmentsBinary.push({
name: binaryData.fileName || 'unknown', name: binaryData.fileName || 'unknown',
content: binaryData.data, content: binaryDataBuffer,
type: binaryData.mimeType, type: binaryData.mimeType,
}); });
} }
@ -644,9 +646,10 @@ export class Gmail implements INodeType {
for (const binaryProperty of (property as string).split(',')) { for (const binaryProperty of (property as string).split(',')) {
if (items[i].binary![binaryProperty] !== undefined) { if (items[i].binary![binaryProperty] !== undefined) {
const binaryData = items[i].binary![binaryProperty]; const binaryData = items[i].binary![binaryProperty];
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty);
attachmentsBinary.push({ attachmentsBinary.push({
name: binaryData.fileName || 'unknown', name: binaryData.fileName || 'unknown',
content: binaryData.data, content: binaryDataBuffer,
type: binaryData.mimeType, type: binaryData.mimeType,
}); });
} }