feat(Gmail Node): Add thread option for draft emails (#8729)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
Nicolas-nwb
2024-04-25 12:56:53 +02:00
committed by GitHub
parent 756012b052
commit 2dd0b329ca
2 changed files with 14 additions and 0 deletions

View File

@@ -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,
},
};