mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
70ae90fa3c
* ⚡ Update `lintfix` script * 👕 Remove unneeded lint exceptions * 👕 Run baseline `lintfix` * 👕 Apply `node-param-description-miscased-url` (#3441) * 👕 Apply `rule node-param-placeholder-miscased-id` (#3443) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-option-name-wrong-for-upsert` (#3446) * 👕 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) * 🔨 fix * ⚡ Fix `Assigned To` fields Co-authored-by: Michael Kret <michael.k@radency.com> * 👕 Apply `rule node-param-default-wrong-for-number` (#3453) * 👕 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) * 🔨 fix * 🔨 exceptions * ⚡ review fixes * 👕 Apply `node-param-description-lowercase-first-char` (#3451) * ⚡ fix * ⚡ review fixes * ⚡ fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-description-wrong-for-dynamic-options` (#3456) * Rule working as intended * Add rule * 🔥 Remove repetitions * 👕 Add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Small fix for `node-param-description-wrong-for-dynamic-options` * 👕 Apply `node-param-default-wrong-for-fixed-collection` (#3460) * 👕 Apply `node-param-description-line-break-html-tag` (#3462) * 👕 Run baseline `lintfix` * 👕 Apply `node-param-options-type-unsorted-items` (#3459) * ⚡ fix * 🔨 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> * ⚡ 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>
463 lines
9.1 KiB
TypeScript
463 lines
9.1 KiB
TypeScript
import {
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export const emailOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
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',
|
|
},
|
|
];
|
|
|
|
export const emailFields: INodeProperties[] = [
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* 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.',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
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 Name or 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. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
|
|
},
|
|
{
|
|
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.',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
default: {},
|
|
description: 'Attachments to be sent with each copy of the email, maximum of 10 with size of 1MB each',
|
|
},
|
|
];
|