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

463 lines
9 KiB
TypeScript
Raw Normal View History

2020-04-01 15:10:41 -07:00
import {
INodeProperties,
2020-04-01 15:55:40 -07:00
} from 'n8n-workflow';
2020-04-01 15:10:41 -07:00
export const emailOperations: INodeProperties[] = [
2020-04-01 15:10:41 -07:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'email',
],
},
},
options: [
{
name: 'Create Record',
value: 'createRecord',
description: 'Create a record of an email sent to a contact',
},
{
name: 'Get All',
value: 'getAll',
description: 'Retrieve all sent emails',
},
{
name: 'Send',
value: 'send',
description: 'Send Email',
},
],
default: 'createRecord',
description: 'The operation to perform.',
},
];
2020-04-01 15:10:41 -07:00
export const emailFields: INodeProperties[] = [
2020-04-01 15:10:41 -07:00
/* -------------------------------------------------------------------------- */
/* email:createRecord */
/* -------------------------------------------------------------------------- */
{
displayName: 'Sent To Address',
name: 'sentToAddress',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'createRecord',
],
resource: [
'email',
],
},
},
default: '',
},
{
displayName: 'Sent From Address',
name: 'sentFromAddress',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'createRecord',
],
resource: [
'email',
],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'createRecord',
],
resource: [
'email',
],
},
},
options: [
{
displayName: 'Clicked Date',
name: 'clickedDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Contact ID',
name: 'contactId',
type: 'number',
typeOptions: {
minValue: 0,
},
default: 0,
},
{
displayName: 'Headers',
name: 'headers',
type: 'string',
default: '',
},
{
displayName: 'HTML content',
name: 'htmlContent',
type: 'string',
default: '',
description: 'Base64 encoded HTML',
},
{
displayName: 'Opened Date',
name: 'openedDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Original Provider',
name: 'originalProvider',
type: 'options',
options: [
{
name: 'Unknown',
value: 'UNKNOWN',
},
{
name: 'Infusionsoft',
value: 'INFUSIONSOFT',
},
{
name: 'Microsoft',
value: 'MICROSOFT',
},
{
name: 'Google',
value: 'GOOGLE',
},
],
default: 'UNKNOWN',
description: 'Provider that sent the email case insensitive, must be in list',
},
{
displayName: 'Original Provider ID',
name: 'originalProviderId',
type: 'string',
default: '',
description: 'Provider ID that sent the email, must be unique when combined with provider. If omitted a UUID without dashes is autogenerated for the record.',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Plain Content',
name: 'plainContent',
type: 'string',
default: '',
description: 'Base64 encoded text',
},
{
displayName: 'Provider Source ID',
name: 'providerSourceId',
type: 'string',
default: 'The email address of the synced email account that generated this message.',
},
{
displayName: 'Received Date',
name: 'receivedDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Sent Date',
name: 'sentDate',
type: 'dateTime',
default: '',
},
{
displayName: 'Sent From Reply Address',
name: 'sentFromReplyAddress',
type: 'string',
default: '',
},
{
displayName: 'Sent To Bcc Addresses',
name: 'sentToBccAddresses',
type: 'string',
default: '',
},
{
displayName: 'Sent To CC Addresses',
name: 'sentToCCAddresses',
type: 'string',
default: '',
},
{
displayName: 'Subject',
name: 'subject',
type: 'string',
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* email:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'email',
],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'email',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 200,
},
default: 100,
description: 'Max number of results to return',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'email',
],
},
},
options: [
{
displayName: 'Contact ID',
name: 'contactId',
type: 'number',
typeOptions: {
minValue: 0,
},
default: 0,
},
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
},
{
displayName: 'Since Sent Date',
name: 'sinceSentDate',
type: 'dateTime',
default: '',
description: 'Emails sent since the provided date, must be present if untilDate is provided',
},
{
displayName: 'Until Sent Date',
name: 'untilSentDate',
type: 'dateTime',
default: '',
description: 'Email sent until the provided date',
},
],
},
/* -------------------------------------------------------------------------- */
/* email:send */
/* -------------------------------------------------------------------------- */
{
displayName: 'User ID',
name: 'userId',
type: 'options',
required: true,
typeOptions: {
loadOptionsMethod: 'getUsers',
},
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'email',
],
},
},
default: '',
description: 'The infusionsoft user to send the email on behalf of',
},
{
displayName: 'Contact IDs',
name: 'contactIds',
type: 'string',
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'email',
],
},
},
default: '',
description: 'Contact IDs to receive the email. Multiple can be added seperated by comma.',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'Subject',
name: 'subject',
type: 'string',
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'email',
],
},
},
default: '',
description: 'The subject line of the email',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'email',
],
},
},
options: [
{
displayName: 'Address field',
name: 'addressField',
type: 'string',
default: '',
description: 'Email field of each Contact record to address the email to, such as \'EmailAddress1\', \'EmailAddress2\', \'EmailAddress3\', defaulting to the contact\'s primary email',
2020-04-01 15:10:41 -07:00
},
{
displayName: 'HTML Content',
name: 'htmlContent',
type: 'string',
default: '',
description: 'The HTML-formatted content of the email, encoded in Base64',
},
{
displayName: 'Plain Content',
name: 'plainContent',
type: 'string',
default: '',
description: 'The plain-text content of the email, encoded in Base64',
},
],
},
{
displayName: 'Attachments',
name: 'attachmentsUi',
placeholder: 'Add Attachments',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'email',
],
},
},
options: [
{
name: 'attachmentsValues',
displayName: 'Attachments Values',
values: [
{
displayName: 'File Data',
name: 'fileData',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: 'The content of the attachment, encoded in Base64',
},
{
displayName: 'File Name',
name: 'fileName',
type: 'string',
default: '',
description: 'The filename of the attached file, including extension',
},
],
},
{
name: 'attachmentsBinary',
displayName: 'Attachments Binary',
values: [
{
displayName: 'Property',
name: 'property',
type: 'string',
default: '',
description: 'Name of the binary properties which contain data which should be added to email as attachment',
},
],
},
],
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :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: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
default: {},
2020-04-01 15:10:41 -07:00
description: 'Attachments to be sent with each copy of the email, maximum of 10 with size of 1MB each',
},
];