2023-01-24 02:32:31 -08:00
|
|
|
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2023-03-09 09:13:15 -08:00
|
|
|
IExecuteFunctions,
|
2023-01-24 02:32:31 -08:00
|
|
|
INodeExecutionData,
|
|
|
|
INodeType,
|
|
|
|
INodeTypeBaseDescription,
|
|
|
|
INodeTypeDescription,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
import * as send from './send.operation';
|
|
|
|
|
|
|
|
const versionDescription: INodeTypeDescription = {
|
|
|
|
displayName: 'Send Email',
|
|
|
|
name: 'emailSend',
|
|
|
|
icon: 'fa:envelope',
|
|
|
|
group: ['output'],
|
2023-10-03 01:18:59 -07:00
|
|
|
version: [2, 2.1],
|
2023-01-24 02:32:31 -08:00
|
|
|
description: 'Sends an email using SMTP protocol',
|
|
|
|
defaults: {
|
|
|
|
name: 'Send Email',
|
|
|
|
color: '#00bb88',
|
|
|
|
},
|
|
|
|
inputs: ['main'],
|
|
|
|
outputs: ['main'],
|
|
|
|
credentials: [
|
|
|
|
{
|
|
|
|
name: 'smtp',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
properties: [
|
|
|
|
{
|
|
|
|
displayName: 'Resource',
|
|
|
|
name: 'resource',
|
|
|
|
type: 'hidden',
|
|
|
|
noDataExpression: true,
|
|
|
|
default: 'email',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Email',
|
|
|
|
value: 'email',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'hidden',
|
|
|
|
noDataExpression: true,
|
|
|
|
default: 'send',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Send',
|
|
|
|
value: 'send',
|
2023-02-17 06:08:26 -08:00
|
|
|
action: 'Send an Email',
|
2023-01-24 02:32:31 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
...send.description,
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
export class EmailSendV2 implements INodeType {
|
|
|
|
description: INodeTypeDescription;
|
|
|
|
|
|
|
|
constructor(baseDescription: INodeTypeBaseDescription) {
|
|
|
|
this.description = {
|
|
|
|
...baseDescription,
|
|
|
|
...versionDescription,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
let returnData: INodeExecutionData[][] = [];
|
|
|
|
|
|
|
|
returnData = await send.execute.call(this);
|
|
|
|
|
|
|
|
return returnData;
|
|
|
|
}
|
|
|
|
}
|