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

430 lines
7.9 KiB
TypeScript
Raw Normal View History

2020-02-13 07:43:59 -08:00
import { INodeProperties } from 'n8n-workflow';
export const emailOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'email',
],
},
},
options: [
{
name: 'Send',
value: 'send',
description: 'Send a email',
},
{
name: 'Send Template',
value: 'sendTemplate',
description: 'Send a email template',
},
],
default: 'send',
description: 'The operation to perform.',
},
] as INodeProperties[];
export const emailFields = [
/* -------------------------------------------------------------------------- */
/* email:send */
/* -------------------------------------------------------------------------- */
{
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',
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: '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: 'Template Language',
name: 'templateLanguage',
type: 'boolean',
default: true,
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',
},
],
2020-02-13 07:43:59 -08:00
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',
name: 'variablesUi',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
resource: [
'email',
],
operation: [
'send',
2020-10-22 06:46:03 -07:00
],
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 */
/* -------------------------------------------------------------------------- */
{
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',
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
},
},
},
{
2020-03-25 11:52:12 -07:00
displayName: 'Template ID',
name: 'templateId',
2020-02-13 07:43:59 -08:00
type: 'string',
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: '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 ,.',
default: '',
},
{
displayName: 'Cc Email',
name: 'ccEmail',
2020-02-13 07:43:59 -08:00
type: 'string',
description: 'Cc recipients of the email separated by ,.',
default: '',
},
{
displayName: 'From Name',
name: 'fromName',
type: 'string',
default: '',
},
{
displayName: 'Priority',
name: 'priority',
type: 'number',
default: 2,
},
{
displayName: 'Subject',
name: 'subject',
type: 'string',
default: '',
},
{
displayName: 'Track Opens',
name: 'trackOpens',
type: 'string',
description: 'Enable or disable open tracking on this message.',
default: '',
},
{
displayName: 'Track Clicks',
name: 'trackClicks',
type: 'string',
description: 'Enable or disable open tracking on this message.',
default: '',
},
{
displayName: 'Template Language',
name: 'templateLanguage',
type: 'boolean',
default: true,
},
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
],
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
},
],
},
] as INodeProperties[];