mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
62c096710f
- Fix autofixable violations - Remove unused directives - Allow for PascalCased variables - needed for dynamically imported or assigned classes, decorators, routers, etc.
81 lines
1.5 KiB
TypeScript
81 lines
1.5 KiB
TypeScript
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
|
import type {
|
|
IExecuteFunctions,
|
|
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'],
|
|
version: [2, 2.1],
|
|
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',
|
|
action: 'Send an Email',
|
|
},
|
|
],
|
|
},
|
|
...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;
|
|
}
|
|
}
|