From 9dec3763fac5df2035b61df1932c2109c38d7eb1 Mon Sep 17 00:00:00 2001 From: Nicolas COMPAIN Date: Mon, 1 Jan 2024 22:56:02 +0100 Subject: [PATCH 1/3] Add threadId parameter to DraftDescription and GmailV2.node.ts --- .../nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts | 8 ++++++++ packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts index 8a87e40d43d37..972720de11b98 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts @@ -151,6 +151,14 @@ export const draftFields: INodeProperties[] = [ default: '', description: 'The email address that the reply message is sent to', }, + { + displayName: 'Attach to Thread', + name: 'threadId', + type: 'string', + placeholder: '18cc573e2431878f', + default: '', + description: 'The identifier of the thread to which to attach the reply email', + }, { displayName: 'Attachments', name: 'attachmentsUi', diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts index a16d9c65d9cf9..ba8bdb668a9e1 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts @@ -528,6 +528,7 @@ export class GmailV2 implements INodeType { let cc = ''; let bcc = ''; let replyTo = ''; + let threadId = null; if (options.sendTo) { to += prepareEmailsInput.call(this, options.sendTo as string, 'To', i); @@ -545,6 +546,10 @@ export class GmailV2 implements INodeType { replyTo = prepareEmailsInput.call(this, options.replyTo as string, 'ReplyTo', i); } + if (options.threadId && typeof options.threadId === 'string') { + threadId = options.threadId; + } + let attachments: IDataObject[] = []; if (options.attachmentsUi) { attachments = await prepareEmailAttachments.call( @@ -574,6 +579,7 @@ export class GmailV2 implements INodeType { const body = { message: { raw: await encodeEmail(email), + threadId: threadId || undefined, }, }; From cbfbbb7787bfa052e4598f77a567a793c61007c1 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Thu, 25 Apr 2024 10:56:27 +0100 Subject: [PATCH 2/3] description update --- packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts index 972720de11b98..6ba1ee4cc3d8e 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts @@ -157,7 +157,7 @@ export const draftFields: INodeProperties[] = [ type: 'string', placeholder: '18cc573e2431878f', default: '', - description: 'The identifier of the thread to which to attach the reply email', + description: 'The identifier of the thread to attach the draft', }, { displayName: 'Attachments', From e66da4d5c9c35ad995037579ab76be9188d31a7c Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Thu, 25 Apr 2024 10:57:16 +0100 Subject: [PATCH 3/3] Update display name --- packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts index 6ba1ee4cc3d8e..e6dd7d86a0fdf 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts @@ -152,7 +152,7 @@ export const draftFields: INodeProperties[] = [ description: 'The email address that the reply message is sent to', }, { - displayName: 'Attach to Thread', + displayName: 'Thread ID', name: 'threadId', type: 'string', placeholder: '18cc573e2431878f',