diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts index 8a87e40d43d37..e6dd7d86a0fdf 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: 'Thread ID', + name: 'threadId', + type: 'string', + placeholder: '18cc573e2431878f', + default: '', + description: 'The identifier of the thread to attach the draft', + }, { 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, }, };