feat(Send Email Node): Add support for sending text and html email simultaneously (#6978)

This commit is contained in:
pemontto 2023-08-21 10:49:33 +01:00 committed by GitHub
parent 475d9c98e8
commit 3860d41d73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,6 +56,10 @@ const properties: INodeProperties[] = [
name: 'HTML',
value: 'html',
},
{
name: 'Both',
value: 'both',
},
],
default: 'text',
},
@ -70,7 +74,7 @@ const properties: INodeProperties[] = [
description: 'Plain text message of email',
displayOptions: {
show: {
emailFormat: ['text'],
emailFormat: ['text', 'both'],
},
},
},
@ -85,7 +89,7 @@ const properties: INodeProperties[] = [
description: 'HTML text message of email',
displayOptions: {
show: {
emailFormat: ['html'],
emailFormat: ['html', 'both'],
},
},
},
@ -208,11 +212,11 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
replyTo: options.replyTo,
};
if (emailFormat === 'text') {
if (emailFormat === 'text' || emailFormat === 'both') {
mailOptions.text = this.getNodeParameter('text', itemIndex, '');
}
if (emailFormat === 'html') {
if (emailFormat === 'html' || emailFormat === 'both') {
mailOptions.html = this.getNodeParameter('html', itemIndex, '');
}