n8n/packages/nodes-base/nodes/Mailjet/EmailDescription.ts

538 lines
9.8 KiB
TypeScript
Raw Normal View History

import {
INodeProperties,
} from 'n8n-workflow';
2020-02-13 07:43:59 -08:00
export const emailOperations: INodeProperties[] = [
2020-02-13 07:43:59 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
2020-02-13 07:43:59 -08:00
displayOptions: {
show: {
resource: [
'email',
],
},
},
options: [
{
name: 'Send',
value: 'send',
description: 'Send a email',
action: 'Send an email',
2020-02-13 07:43:59 -08:00
},
{
name: 'Send Template',
value: 'sendTemplate',
description: 'Send a email template',
action: 'Send an email template',
2020-02-13 07:43:59 -08:00
},
],
default: 'send',
},
];
2020-02-13 07:43:59 -08:00
export const emailFields: INodeProperties[] = [
2020-02-13 07:43:59 -08:00
/* -------------------------------------------------------------------------- */
/* email:send */
/* -------------------------------------------------------------------------- */
2020-02-13 07:43:59 -08:00
{
displayName: 'From Email',
name: 'fromEmail',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
placeholder: 'admin@example.com',
2020-02-13 07:43:59 -08:00
description: 'The title for the email',
},
{
displayName: 'To Email',
name: 'toEmail',
type: 'string',
default: '',
2020-02-13 07:43:59 -08:00
required: true,
placeholder: 'info@example.com',
description: 'Email address of the recipient. Multiple ones can be separated by comma.',
2020-02-13 07:43:59 -08:00
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
},
{
displayName: 'Subject',
name: 'subject',
type: 'string',
default: '',
placeholder: 'My subject line',
description: 'Subject line of the email',
},
{
displayName: 'Text',
name: 'text',
2020-02-13 07:43:59 -08:00
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
default: '',
description: 'Plain text message of email',
2020-02-13 07:43:59 -08:00
},
{
displayName: 'HTML',
name: 'html',
2020-02-13 07:43:59 -08:00
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
2020-02-13 07:43:59 -08:00
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
default: '',
description: 'HTML text message of email',
2020-02-13 07:43:59 -08:00
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
],
},
},
},
2020-02-13 07:43:59 -08:00
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
],
},
},
options: [
{
displayName: 'Bcc Email',
name: 'bccEmail',
2020-02-13 07:43:59 -08:00
type: 'string',
description: 'Bcc Email address of the recipient. Multiple ones can be separated by comma.',
default: '',
},
{
displayName: 'Cc Addresses',
name: 'ccAddresses',
type: 'string',
description: 'Cc Email address of the recipient. Multiple ones can be separated by comma.',
default: '',
},
{
displayName: 'From Name',
name: 'fromName',
type: 'string',
default: '',
},
{
displayName: 'Priority',
name: 'priority',
type: 'number',
default: 2,
},
{
displayName: 'Reply To',
name: 'replyTo',
type: 'string',
description: 'The reply-to email address. Multiple ones can be separated by comma.',
default: '',
},
2020-02-13 07:43:59 -08:00
{
displayName: 'Template Language',
name: 'templateLanguage',
type: 'boolean',
default: false,
2020-02-13 07:43:59 -08:00
},
{
displayName: 'Track Clicks',
name: 'trackClicks',
type: 'options',
options: [
{
name: 'Account Default',
value: 'account_default',
description: 'Use the values specified in the Mailjet account',
},
{
name: 'Disabled',
value: 'disabled',
description: 'Disable tracking for this message',
},
{
name: 'Enabled',
value: 'enabled',
description: 'Enable tracking for this message',
},
],
description: 'Enable or disable open tracking on this message',
default: 'account_default',
2020-02-13 07:43:59 -08:00
},
{
displayName: 'Track Opens',
name: 'trackOpens',
type: 'options',
options: [
{
name: 'Account Default',
value: 'account_default',
description: 'Use the values specified in the Mailjet account',
},
{
name: 'Disabled',
value: 'disabled',
description: 'Disable tracking for this message',
},
{
name: 'Enabled',
value: 'enabled',
description: 'Enable tracking for this message',
},
],
description: 'Enable or disable open tracking on this message',
default: 'account_default',
2020-02-13 07:43:59 -08:00
},
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
{
displayName: 'Variables (JSON)',
name: 'variablesJson',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
],
jsonParameters: [
true,
],
},
},
default: '',
description: 'HTML text message of email',
},
2020-02-13 07:43:59 -08:00
{
displayName: 'Variables',
name: 'variablesUi',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
2020-10-22 06:46:03 -07:00
],
jsonParameters: [
false,
],
2020-02-13 07:43:59 -08:00
},
},
placeholder: 'Add Variable',
default: {},
options: [
{
name: 'variablesValues',
displayName: 'Variable',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
],
},
/* -------------------------------------------------------------------------- */
/* email:sendTemplate */
/* -------------------------------------------------------------------------- */
2020-02-13 07:43:59 -08:00
{
displayName: 'From Email',
name: 'fromEmail',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
placeholder: 'admin@example.com',
2020-02-13 07:43:59 -08:00
description: 'The title for the email',
},
{
displayName: 'To Email',
name: 'toEmail',
2020-02-13 07:43:59 -08:00
type: 'string',
default: '',
2020-02-13 07:43:59 -08:00
required: true,
placeholder: 'info@example.com',
description: 'Email address of the recipient. Multiple ones can be separated by comma.',
2020-02-13 07:43:59 -08:00
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
},
{
refactor: Apply more `eslint-plugin-n8n-nodes-base` autofixable rules (#3432) * :zap: Update `lintfix` script * :shirt: Remove unneeded lint exceptions * :shirt: Run baseline `lintfix` * :shirt: Apply `node-param-description-miscased-url` (#3441) * :shirt: Apply `rule node-param-placeholder-miscased-id` (#3443) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-name-wrong-for-upsert` (#3446) * :shirt: Apply `node-param-min-value-wrong-for-limit` (#3442) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * Apply `node-param-display-name-wrong-for-dynamic-options` (#3454) * :hammer: fix * :zap: Fix `Assigned To` fields Co-authored-by: Michael Kret <michael.k@radency.com> * :shirt: Apply `rule node-param-default-wrong-for-number` (#3453) * :shirt: Apply `node-param-default-wrong-for-string` (#3452) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * Apply `node-param-display-name-miscased` (#3449) * :hammer: fix * :hammer: exceptions * :zap: review fixes * :shirt: Apply `node-param-description-lowercase-first-char` (#3451) * :zap: fix * :zap: review fixes * :zap: fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-wrong-for-dynamic-options` (#3456) * Rule working as intended * Add rule * :fire: Remove repetitions * :shirt: Add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Small fix for `node-param-description-wrong-for-dynamic-options` * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3460) * :shirt: Apply `node-param-description-line-break-html-tag` (#3462) * :shirt: Run baseline `lintfix` * :shirt: Apply `node-param-options-type-unsorted-items` (#3459) * :zap: fix * :hammer: exceptions * Add exception for Salesmate and Zoom Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :zap: Restore `lintfix` command Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com>
2022-06-03 10:23:49 -07:00
displayName: 'Template Name or ID',
name: 'templateId',
type: 'options',
refactor: Apply more `eslint-plugin-n8n-nodes-base` rules (#3534) * :zap: Update `lintfix` script * :zap: Run baseline `lintfix` * :fire: Remove unneeded exceptions (#3538) * :fire: Remove exceptions for `node-param-default-wrong-for-simplify` * :fire: Remove exceptions for `node-param-placeholder-miscased-id` * :zap: Update version * :shirt: Apply `node-param-placeholder-missing` (#3542) * :shirt: Apply `filesystem-wrong-cred-filename` (#3543) * :shirt: Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-class-description-empty-string` (#3546) * :shirt: Apply `node-class-description-icon-not-svg` (#3548) * :shirt: Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Expand lintings to credentials (#3550) * :shirt: Apply `node-param-multi-options-type-unsorted-items` (#3552) * :zap: fix * :zap: Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * :shirt: Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * :zap: Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * :zap: Fix with updated linting rules * :zap: Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-boolean-without-whether` (#3553) * :zap: fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * :shirt: Add exceptions * :shirt: Add exception * :pencil2: Alphabetize rules * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
2022-06-20 07:54:01 -07:00
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>',
typeOptions: {
loadOptionsMethod: 'getTemplates',
},
2020-02-13 07:43:59 -08:00
required: true,
default: '',
2020-02-13 07:43:59 -08:00
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
},
},
{
displayName: 'JSON Parameters',
name: 'jsonParameters',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
],
},
},
},
2020-02-13 07:43:59 -08:00
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
],
},
},
options: [
{
displayName: 'Bcc Email',
name: 'bccEmail',
2020-02-13 07:43:59 -08:00
type: 'string',
description: 'BCC Recipients of the email separated by ,',
2020-02-13 07:43:59 -08:00
default: '',
},
{
displayName: 'Cc Email',
name: 'ccEmail',
2020-02-13 07:43:59 -08:00
type: 'string',
description: 'Cc recipients of the email separated by ,',
2020-02-13 07:43:59 -08:00
default: '',
},
{
displayName: 'From Name',
name: 'fromName',
type: 'string',
default: '',
},
{
displayName: 'Priority',
name: 'priority',
type: 'number',
default: 2,
},
{
displayName: 'Reply To',
name: 'replyTo',
type: 'string',
description: 'The reply-to email address. Multiple ones can be separated by comma.',
default: '',
},
2020-02-13 07:43:59 -08:00
{
displayName: 'Subject',
name: 'subject',
type: 'string',
default: '',
},
{
displayName: 'Template Language',
name: 'templateLanguage',
type: 'boolean',
default: false,
2020-02-13 07:43:59 -08:00
},
{
displayName: 'Track Clicks',
name: 'trackClicks',
type: 'string',
description: 'Enable or disable open tracking on this message',
2020-02-13 07:43:59 -08:00
default: '',
},
{
displayName: 'Track Opens',
name: 'trackOpens',
type: 'string',
description: 'Enable or disable open tracking on this message',
default: '',
2020-02-13 07:43:59 -08:00
},
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
{
displayName: 'Variables',
name: 'variablesUi',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
2020-10-22 06:46:03 -07:00
],
jsonParameters: [
false,
],
2020-02-13 07:43:59 -08:00
},
},
placeholder: 'Add Variable',
default: {},
options: [
{
name: 'variablesValues',
displayName: 'Variable',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
},
2020-10-22 06:46:03 -07:00
],
2020-02-13 07:43:59 -08:00
},
],
},
{
displayName: 'Variables (JSON)',
name: 'variablesJson',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'sendTemplate',
],
jsonParameters: [
true,
],
},
},
default: '',
description: 'HTML text message of email',
},
];