mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
feat(core): Add "Sent by n8n" attribution (#7183)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ const versionDescription: INodeTypeDescription = {
|
||||
name: 'gmail',
|
||||
icon: 'file:gmail.svg',
|
||||
group: ['transform'],
|
||||
version: 2,
|
||||
version: [2, 2.1],
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
description: 'Consume the Gmail API',
|
||||
defaults: {
|
||||
@@ -205,6 +205,8 @@ export class GmailV2 implements INodeType {
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
const resource = this.getNodeParameter('resource', 0);
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
const nodeVersion = this.getNode().typeVersion;
|
||||
const instanceId = await this.getInstanceId();
|
||||
|
||||
let responseData;
|
||||
|
||||
@@ -323,6 +325,11 @@ export class GmailV2 implements INodeType {
|
||||
from = `${options.senderName as string} <${emailAddress}>`;
|
||||
}
|
||||
|
||||
let appendAttribution = options.appendAttribution;
|
||||
if (appendAttribution === undefined) {
|
||||
appendAttribution = nodeVersion >= 2.1;
|
||||
}
|
||||
|
||||
const email: IEmail = {
|
||||
from,
|
||||
to,
|
||||
@@ -330,7 +337,7 @@ export class GmailV2 implements INodeType {
|
||||
bcc,
|
||||
replyTo,
|
||||
subject: this.getNodeParameter('subject', i) as string,
|
||||
...prepareEmailBody.call(this, i),
|
||||
...prepareEmailBody.call(this, i, appendAttribution as boolean, instanceId),
|
||||
attachments,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user