diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index 778f6ea2f6f..d76dd48d28e 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -142,6 +142,7 @@ export async function encodeEmail(email: IEmail) { let mailBody: Buffer; const mailOptions = { + from: email.from, to: email.to, cc: email.cc, bcc: email.bcc, diff --git a/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts b/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts index 1107630f052..5b72a2c80e4 100644 --- a/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/Gmail.node.ts @@ -45,6 +45,7 @@ import { } from 'lodash'; export interface IEmail { + from?: string; to?: string; cc?: string; bcc?: string; @@ -355,6 +356,7 @@ export class Gmail implements INodeType { } const email: IEmail = { + from: additionalFields.senderName as string || '', to: toStr, cc: ccStr, bcc: bccStr, @@ -455,6 +457,7 @@ export class Gmail implements INodeType { } const email: IEmail = { + from: additionalFields.senderName as string || '', to: toStr, cc: ccStr, bcc: bccStr, diff --git a/packages/nodes-base/nodes/Google/Gmail/MessageDescription.ts b/packages/nodes-base/nodes/Google/Gmail/MessageDescription.ts index a8605809510..a257985509f 100644 --- a/packages/nodes-base/nodes/Google/Gmail/MessageDescription.ts +++ b/packages/nodes-base/nodes/Google/Gmail/MessageDescription.ts @@ -277,6 +277,16 @@ export const messageFields = [ placeholder: 'info@example.com', default: [], }, + { + displayName: 'Sender Name', + name: 'senderName', + type: 'string', + placeholder: 'Name ', + default: '', + description: `The name displayed in your contacts inboxes.
+ It has to be in the format: "Display-Name <name@gmail.com>".
+ The email address has to match the email address of the logged in user for the API`, + }, ], }, {