Extend Mautic node (#2839)

* re-submit for #2218

*  small fixes

*  nodelinter fixes

*  Improvements

*  Improvements

*  Add description and fix default value

Co-authored-by: Luiz Eduardo de Oliveira Fonseca <luizeof@gmail.com>
Co-authored-by: michael-radency <michael.k@radency.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Ricardo Espinoza
2022-02-28 03:04:55 -05:00
committed by GitHub
parent 7d5f65d8c0
commit 2ec4ed6592
5 changed files with 514 additions and 123 deletions

View File

@@ -25,6 +25,16 @@ export const contactOperations: INodeProperties[] = [
value: 'delete',
description: 'Delete a contact',
},
{
name: 'Edit Contact Points',
value: 'editContactPoint',
description: 'Edit contact\'s points',
},
{
name: 'Edit Do Not Contact List',
value: 'editDoNotContactList',
description: 'Add/remove contacts from/to the do not contact list',
},
{
name: 'Get',
value: 'get',
@@ -35,6 +45,11 @@ export const contactOperations: INodeProperties[] = [
value: 'getAll',
description: 'Get data of all contacts',
},
{
name: 'Send Email',
value: 'sendEmail',
description: 'Send email to contact',
},
{
name: 'Update',
value: 'update',
@@ -1029,6 +1044,187 @@ export const contactFields: INodeProperties[] = [
],
},
/* -------------------------------------------------------------------------- */
/* contact:editDoNotContactList */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
displayOptions: {
show: {
operation: [
'editDoNotContactList',
],
resource: [
'contact',
],
},
},
default: '',
description: 'Contact ID',
},
{
displayName: 'Action',
name: 'action',
type: 'options',
displayOptions: {
show: {
operation: [
'editDoNotContactList',
],
resource: [
'contact',
],
},
},
options: [
{
name: 'Add',
value: 'add',
},
{
name: 'Remove',
value: 'remove',
},
],
default: 'add',
},
{
displayName: 'Channel',
name: 'channel',
type: 'options',
required: true,
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'editDoNotContactList',
],
},
},
options: [
{
name: 'Email',
value: 'email',
},
{
name: 'SMS',
value: 'sms',
},
],
default: 'email',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'editDoNotContactList',
],
},
},
options: [
{
displayName: 'Reason To Do Not Contact',
name: 'reason',
type: 'options',
options: [
{
name: 'Unsubscribed',
value: '1',
},
{
name: 'Bounced',
value: '2',
},
{
name: 'Manual',
value: '3',
},
],
default: '3',
},
{
displayName: 'Comments',
name: 'comments',
type: 'string',
default: '',
description: 'A text describing details of Do Not Contact entry',
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:editContactPoint */
/* -------------------------------------------------------------------------- */
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
displayOptions: {
show: {
operation: [
'editContactPoint',
],
resource: [
'contact',
],
},
},
default: '',
description: 'Contact ID',
},
{
displayName: 'Action',
name: 'action',
type: 'options',
displayOptions: {
show: {
operation: [
'editContactPoint',
],
resource: [
'contact',
],
},
},
options: [
{
name: 'Add',
value: 'add',
},
{
name: 'Remove',
value: 'remove',
},
],
default: 'add',
},
{
displayName: 'Points',
name: 'points',
type: 'number',
displayOptions: {
show: {
operation: [
'editContactPoint',
],
resource: [
'contact',
],
},
},
default: 0,
},
/* -------------------------------------------------------------------------- */
/* contact:get */
/* -------------------------------------------------------------------------- */
@@ -1129,6 +1325,13 @@ export const contactFields: INodeProperties[] = [
'contact',
],
},
hide: {
operation: [
'sendEmail',
'editDoNotContactList',
'editContactPoint',
],
},
},
placeholder: 'Add Option',
default: {},
@@ -1238,5 +1441,44 @@ export const contactFields: INodeProperties[] = [
},
],
},
/* -------------------------------------------------------------------------- */
/* contact:sendEmail */
/* -------------------------------------------------------------------------- */
{
displayName: 'Campaign Email ID',
name: 'campaignEmailId',
type: 'options',
required: true,
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'sendEmail',
],
},
},
typeOptions: {
loadOptionsMethod: 'getCampaignEmails',
},
default: '',
},
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: [
'contact',
],
operation: [
'sendEmail',
],
},
},
default: '',
},
];