mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -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',
|
||||
name: 'firstName',
|
||||
|
@ -298,6 +318,20 @@ export const contactFields = [
|
|||
default: '',
|
||||
description: 'Contact parameters',
|
||||
},
|
||||
{
|
||||
displayName: 'Email',
|
||||
name: 'email',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [
|
||||
false,
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Email address of the contact.',
|
||||
},
|
||||
{
|
||||
displayName: 'First Name',
|
||||
name: 'firstName',
|
||||
|
|
|
@ -106,16 +106,12 @@ export class Mautic implements INodeType {
|
|||
const jsonActive = this.getNodeParameter('jsonParameters', i) as boolean;
|
||||
let body: IDataObject = {};
|
||||
if (!jsonActive) {
|
||||
const firstName = this.getNodeParameter('firstName', i) as string;
|
||||
const lastName = this.getNodeParameter('lastName', i) as string;
|
||||
const company = this.getNodeParameter('company', i) as string;
|
||||
const position = this.getNodeParameter('position', i) as string;
|
||||
const title = this.getNodeParameter('title', i) as string;
|
||||
body.firstname = firstName;
|
||||
body.lastname = lastName;
|
||||
body.company = company;
|
||||
body.position = position;
|
||||
body.title = title;
|
||||
body.email = this.getNodeParameter('email', i) as string;
|
||||
body.firstname = this.getNodeParameter('firstName', i) as string;
|
||||
body.lastname = this.getNodeParameter('lastName', i) as string;
|
||||
body.company = this.getNodeParameter('company', i) as string;
|
||||
body.position = this.getNodeParameter('position', i) as string;
|
||||
body.title = this.getNodeParameter('title', i) as string;
|
||||
} else {
|
||||
const json = validateJSON(this.getNodeParameter('bodyJson', i) as string);
|
||||
if (json !== undefined) {
|
||||
|
@ -145,6 +141,9 @@ export class Mautic implements INodeType {
|
|||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
let body: IDataObject = {};
|
||||
if (updateFields.email) {
|
||||
body.email = updateFields.email as string;
|
||||
}
|
||||
if (updateFields.firstName) {
|
||||
body.firstname = updateFields.firstName as string;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue