mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
feat(core): Add support for oauth based service accounts with UM SMTP (#7311)
This PR adds support for using OAuth based service accounts for the User Management SMTP connection. Tested using a Google Service Account.
This commit is contained in:
parent
91dfc4d513
commit
647372be27
|
@ -26,6 +26,20 @@ export class NodeMailer {
|
|||
};
|
||||
}
|
||||
|
||||
if (
|
||||
config.getEnv('userManagement.emails.smtp.auth.serviceClient') &&
|
||||
config.getEnv('userManagement.emails.smtp.auth.privateKey')
|
||||
) {
|
||||
transportConfig.auth = {
|
||||
type: 'OAuth2',
|
||||
user: config.getEnv('userManagement.emails.smtp.auth.user'),
|
||||
serviceClient: config.getEnv('userManagement.emails.smtp.auth.serviceClient'),
|
||||
privateKey: config
|
||||
.getEnv('userManagement.emails.smtp.auth.privateKey')
|
||||
.replace(/\\n/g, '\n'),
|
||||
};
|
||||
}
|
||||
|
||||
this.transport = createTransport(transportConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -767,6 +767,18 @@ export const schema = {
|
|||
default: '',
|
||||
env: 'N8N_SMTP_PASS',
|
||||
},
|
||||
serviceClient: {
|
||||
doc: 'SMTP OAuth Service Client',
|
||||
format: String,
|
||||
default: '',
|
||||
env: 'N8N_SMTP_OAUTH_SERVICE_CLIENT',
|
||||
},
|
||||
privateKey: {
|
||||
doc: 'SMTP OAuth Private Key',
|
||||
format: String,
|
||||
default: '',
|
||||
env: 'N8N_SMTP_OAUTH_PRIVATE_KEY',
|
||||
},
|
||||
},
|
||||
sender: {
|
||||
doc: 'How to display sender name',
|
||||
|
|
Loading…
Reference in a new issue