From 1a9c435caf2907f41fc5c3fe209bedbf4a9a2736 Mon Sep 17 00:00:00 2001 From: pemontto Date: Fri, 1 Jul 2022 11:46:55 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20Add=20`Content-ID`=20for=20emai?= =?UTF-8?q?l=20attachments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nodes-base/nodes/EmailSend/EmailSend.node.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts b/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts index 78207c40ce502..1734f5f61d038 100644 --- a/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts +++ b/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts @@ -192,6 +192,7 @@ export class EmailSend implements INodeType { attachments.push({ filename: item.binary[propertyName].fileName || 'unknown', content: await this.helpers.getBinaryDataBuffer(itemIndex, propertyName), + cid: propertyName, }); } From 2fa62c53a252cf61f77215bf536fdf4ed3cd4a1c Mon Sep 17 00:00:00 2001 From: pemontto Date: Fri, 1 Jul 2022 11:48:30 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20Fix=20circular=20reference?= =?UTF-8?q?=20in=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/nodes-base/nodes/EmailSend/EmailSend.node.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts b/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts index 1734f5f61d038..1b3e09c04f3f2 100644 --- a/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts +++ b/packages/nodes-base/nodes/EmailSend/EmailSend.node.ts @@ -4,7 +4,7 @@ import { INodeExecutionData, INodeType, INodeTypeDescription, - NodeOperationError, + NodeApiError, } from 'n8n-workflow'; import { createTransport } from 'nodemailer'; @@ -224,7 +224,9 @@ export class EmailSend implements INodeType { }); continue; } - throw error; + // Remove object that creates circular reference + delete error.cert; + throw new NodeApiError(this.getNode(), error ); } } From 39913e8f8b1c0623e5384dcc4066c942ab3c0272 Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Fri, 19 May 2023 09:22:40 +0300 Subject: [PATCH 3/3] :zap: updated with master, description update --- packages/nodes-base/nodes/EmailSend/v2/send.operation.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts b/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts index 330aa7c7b7554..0c2dda97ed481 100644 --- a/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts +++ b/packages/nodes-base/nodes/EmailSend/v2/send.operation.ts @@ -3,7 +3,9 @@ import type { IExecuteFunctions, INodeExecutionData, INodeProperties, + JsonObject, } from 'n8n-workflow'; +import { NodeApiError } from 'n8n-workflow'; import { createTransport } from 'nodemailer'; import type SMTPTransport from 'nodemailer/lib/smtp-transport'; @@ -100,7 +102,7 @@ const properties: INodeProperties[] = [ type: 'string', default: '', description: - 'Name of the binary properties that contain data to add to email as attachment. Multiple ones can be comma-separated.', + 'Name of the binary properties that contain data to add to email as attachment. Multiple ones can be comma-separated. Reference embedded images or other content within the body of an email message, e.g. <img src="cid:image_1">', }, { displayName: 'CC Email', @@ -227,6 +229,7 @@ export async function execute(this: IExecuteFunctions): Promise