mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
⚡ Add email field to Mautic-Node
This commit is contained in:
parent
fb6c939e8d
commit
2f6bab36b2
|
@ -66,6 +66,26 @@ export const contactFields = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Email',
|
||||||
|
name: 'email',
|
||||||
|
type: 'string',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
resource: [
|
||||||
|
'contact',
|
||||||
|
],
|
||||||
|
operation: [
|
||||||
|
'create',
|
||||||
|
],
|
||||||
|
jsonParameters: [
|
||||||
|
false,
|
||||||
|
]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
description: 'Email address of the contact.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'First Name',
|
displayName: 'First Name',
|
||||||
name: 'firstName',
|
name: 'firstName',
|
||||||
|
@ -298,6 +318,20 @@ export const contactFields = [
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Contact parameters',
|
description: 'Contact parameters',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Email',
|
||||||
|
name: 'email',
|
||||||
|
type: 'string',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
'/jsonParameters': [
|
||||||
|
false,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
description: 'Email address of the contact.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'First Name',
|
displayName: 'First Name',
|
||||||
name: 'firstName',
|
name: 'firstName',
|
||||||
|
|
|
@ -106,16 +106,12 @@ export class Mautic implements INodeType {
|
||||||
const jsonActive = this.getNodeParameter('jsonParameters', i) as boolean;
|
const jsonActive = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||||
let body: IDataObject = {};
|
let body: IDataObject = {};
|
||||||
if (!jsonActive) {
|
if (!jsonActive) {
|
||||||
const firstName = this.getNodeParameter('firstName', i) as string;
|
body.email = this.getNodeParameter('email', i) as string;
|
||||||
const lastName = this.getNodeParameter('lastName', i) as string;
|
body.firstname = this.getNodeParameter('firstName', i) as string;
|
||||||
const company = this.getNodeParameter('company', i) as string;
|
body.lastname = this.getNodeParameter('lastName', i) as string;
|
||||||
const position = this.getNodeParameter('position', i) as string;
|
body.company = this.getNodeParameter('company', i) as string;
|
||||||
const title = this.getNodeParameter('title', i) as string;
|
body.position = this.getNodeParameter('position', i) as string;
|
||||||
body.firstname = firstName;
|
body.title = this.getNodeParameter('title', i) as string;
|
||||||
body.lastname = lastName;
|
|
||||||
body.company = company;
|
|
||||||
body.position = position;
|
|
||||||
body.title = title;
|
|
||||||
} else {
|
} else {
|
||||||
const json = validateJSON(this.getNodeParameter('bodyJson', i) as string);
|
const json = validateJSON(this.getNodeParameter('bodyJson', i) as string);
|
||||||
if (json !== undefined) {
|
if (json !== undefined) {
|
||||||
|
@ -145,6 +141,9 @@ export class Mautic implements INodeType {
|
||||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||||
let body: IDataObject = {};
|
let body: IDataObject = {};
|
||||||
|
if (updateFields.email) {
|
||||||
|
body.email = updateFields.email as string;
|
||||||
|
}
|
||||||
if (updateFields.firstName) {
|
if (updateFields.firstName) {
|
||||||
body.firstname = updateFields.firstName as string;
|
body.firstname = updateFields.firstName as string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue