2021-02-20 12:12:55 -08:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const contactListOperations : INodeProperties [ ] = [
2021-02-20 12:12:55 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-04-01 01:12:47 -07:00
default : 'getAll' ,
noDataExpression : true ,
2021-02-20 12:12:55 -08:00
options : [
{
name : 'Add' ,
value : 'add' ,
2022-07-10 13:50:51 -07:00
action : 'Add a contact list' ,
2021-02-20 12:12:55 -08:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
2022-07-10 13:50:51 -07:00
action : 'Get all contact lists' ,
2021-02-20 12:12:55 -08:00
} ,
] ,
displayOptions : {
show : {
resource : [
'contactList' ,
] ,
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-02-20 12:12:55 -08:00
2021-12-03 00:44:16 -08:00
export const contactListFields : INodeProperties [ ] = [
2021-02-20 12:12:55 -08:00
// ----------------------------------
// contactList: add
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Contact List Name or ID' ,
2021-02-20 12:12:55 -08:00
name : 'contactListId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getContactLists' ,
} ,
default : [ ] ,
required : true ,
2022-07-14 13:05:11 -07:00
description : 'The ID of the contact list to add the contact to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-02-20 12:12:55 -08:00
displayOptions : {
show : {
resource : [
'contactList' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
} ,
{
displayName : 'Contact Email' ,
name : 'contactEmail' ,
type : 'string' ,
required : true ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'The email of the contact to add to the contact list' ,
2021-02-20 12:12:55 -08:00
displayOptions : {
show : {
resource : [
'contactList' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'contactList' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
options : [
{
displayName : 'Custom Fields' ,
name : 'customFieldsUi' ,
placeholder : 'Add Custom Field' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
2022-04-01 01:12:47 -07:00
description : 'Filter by custom fields' ,
2021-02-20 12:12:55 -08:00
default : { } ,
options : [
{
name : 'customFieldsValues' ,
displayName : 'Custom Field' ,
values : [
{
displayName : 'Field Name' ,
name : 'fieldName' ,
type : 'string' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'The name of the field to add custom field to' ,
2021-02-20 12:12:55 -08:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'The value to set on custom field' ,
2021-02-20 12:12:55 -08:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'First Name' ,
name : 'firstName' ,
type : 'string' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'First name of the contact to add' ,
2021-02-20 12:12:55 -08:00
} ,
{
displayName : 'Last Contacted' ,
name : 'lastContacted' ,
type : 'dateTime' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'Last contacted date of the contact to add' ,
} ,
{
displayName : 'Last Name' ,
name : 'lastName' ,
type : 'string' ,
default : '' ,
description : 'Last name of the contact to add' ,
2021-02-20 12:12:55 -08:00
} ,
{
displayName : 'Last Open' ,
name : 'lastOpen' ,
type : 'dateTime' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'Last opened date of the contact to add' ,
2021-02-20 12:12:55 -08:00
} ,
{
displayName : 'Last Replied' ,
name : 'lastReplied' ,
type : 'dateTime' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'Last replied date of the contact to add' ,
2021-02-20 12:12:55 -08:00
} ,
{
displayName : 'Mails Sent' ,
name : 'mailsSent' ,
type : 'number' ,
default : 0 ,
2022-04-01 01:12:47 -07:00
description : 'Number of emails sent to the contact to add' ,
2021-02-20 12:12:55 -08:00
} ,
{
displayName : 'Phone Number' ,
name : 'phoneNumber' ,
type : 'string' ,
default : '' ,
2022-04-01 01:12:47 -07:00
description : 'Phone number of the contact to add' ,
2021-02-20 12:12:55 -08:00
} ,
] ,
} ,
// ----------------------------------
// contactList: getAll
// ----------------------------------
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
default : false ,
2022-04-01 01:12:47 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2021-02-20 12:12:55 -08:00
displayOptions : {
show : {
resource : [
'contactList' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
default : 100 ,
2022-04-01 01:12:47 -07:00
description : 'Max number of results to return' ,
2021-02-20 12:12:55 -08:00
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
displayOptions : {
show : {
resource : [
'contactList' ,
] ,
operation : [
'getAll' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;