mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
feat(Gmail Node): Add reply to email (#6453)
Co-authored-by: Matthias Stallmann <feelgood.interface@gmail.com>
This commit is contained in:
@@ -21,7 +21,7 @@ import {
|
||||
prepareEmailBody,
|
||||
prepareEmailsInput,
|
||||
prepareQuery,
|
||||
replayToEmail,
|
||||
replyToEmail,
|
||||
simplifyOutput,
|
||||
unescapeSnippets,
|
||||
} from '../GenericFunctions';
|
||||
@@ -282,6 +282,7 @@ export class GmailV2 implements INodeType {
|
||||
const to = prepareEmailsInput.call(this, sendTo, 'To', i);
|
||||
let cc = '';
|
||||
let bcc = '';
|
||||
let replyTo = '';
|
||||
|
||||
if (options.ccList) {
|
||||
cc = prepareEmailsInput.call(this, options.ccList as string, 'CC', i);
|
||||
@@ -291,6 +292,10 @@ export class GmailV2 implements INodeType {
|
||||
bcc = prepareEmailsInput.call(this, options.bccList as string, 'BCC', i);
|
||||
}
|
||||
|
||||
if (options.replyTo) {
|
||||
replyTo = prepareEmailsInput.call(this, options.replyTo as string, 'ReplyTo', i);
|
||||
}
|
||||
|
||||
let attachments: IDataObject[] = [];
|
||||
|
||||
if (options.attachmentsUi) {
|
||||
@@ -323,6 +328,7 @@ export class GmailV2 implements INodeType {
|
||||
to,
|
||||
cc,
|
||||
bcc,
|
||||
replyTo,
|
||||
subject: this.getNodeParameter('subject', i) as string,
|
||||
...prepareEmailBody.call(this, i),
|
||||
attachments,
|
||||
@@ -340,7 +346,7 @@ export class GmailV2 implements INodeType {
|
||||
const messageIdGmail = this.getNodeParameter('messageId', i) as string;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
responseData = await replayToEmail.call(this, items, messageIdGmail, options, i);
|
||||
responseData = await replyToEmail.call(this, items, messageIdGmail, options, i);
|
||||
}
|
||||
if (operation === 'get') {
|
||||
//https://developers.google.com/gmail/api/v1/reference/users/messages/get
|
||||
@@ -514,6 +520,7 @@ export class GmailV2 implements INodeType {
|
||||
let to = '';
|
||||
let cc = '';
|
||||
let bcc = '';
|
||||
let replyTo = '';
|
||||
|
||||
if (options.sendTo) {
|
||||
to += prepareEmailsInput.call(this, options.sendTo as string, 'To', i);
|
||||
@@ -527,6 +534,10 @@ export class GmailV2 implements INodeType {
|
||||
bcc = prepareEmailsInput.call(this, options.bccList as string, 'BCC', i);
|
||||
}
|
||||
|
||||
if (options.replyTo) {
|
||||
replyTo = prepareEmailsInput.call(this, options.replyTo as string, 'ReplyTo', i);
|
||||
}
|
||||
|
||||
let attachments: IDataObject[] = [];
|
||||
if (options.attachmentsUi) {
|
||||
attachments = await prepareEmailAttachments.call(
|
||||
@@ -547,6 +558,7 @@ export class GmailV2 implements INodeType {
|
||||
to,
|
||||
cc,
|
||||
bcc,
|
||||
replyTo,
|
||||
subject: this.getNodeParameter('subject', i) as string,
|
||||
...prepareEmailBody.call(this, i),
|
||||
attachments,
|
||||
@@ -741,7 +753,7 @@ export class GmailV2 implements INodeType {
|
||||
const messageIdGmail = this.getNodeParameter('messageId', i) as string;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
responseData = await replayToEmail.call(this, items, messageIdGmail, options, i);
|
||||
responseData = await replyToEmail.call(this, items, messageIdGmail, options, i);
|
||||
}
|
||||
if (operation === 'trash') {
|
||||
//https://developers.google.com/gmail/api/reference/rest/v1/users.threads/trash
|
||||
|
||||
Reference in New Issue
Block a user