Skip to content

Commit

Permalink
feat(Salesforce Node): Add fax field to lead option (n8n-io#7030)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnaveen authored Sep 7, 2023
1 parent 9af626a commit 01f875a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/nodes-base/nodes/Salesforce/LeadDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ export const leadFields: INodeProperties[] = [
default: '',
description: 'Email address for the lead',
},
{
displayName: 'Fax',
name: 'fax',
type: 'number',
default: '',
description: 'Fax number of the lead',
},
{
displayName: 'First Name',
name: 'firstname',
Expand All @@ -243,6 +250,14 @@ export const leadFields: INodeProperties[] = [
description:
'Whether the lead doesn’t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.',
},
{
displayName: 'Has Opted Out of Fax',
name: 'hasOptedOutOfFax',
type: 'boolean',
default: false,
description:
'Whether the lead doesn’t want to receive fax from Salesforce (true) or does (false). Label is Email Opt Out.',
},
{
displayName: 'Industry',
name: 'industry',
Expand Down Expand Up @@ -497,6 +512,13 @@ export const leadFields: INodeProperties[] = [
default: '',
description: 'Email address for the lead',
},
{
displayName: 'Fax',
name: 'fax',
type: 'number',
default: '',
description: 'Fax Number of the lead',
},
{
displayName: 'First Name',
name: 'firstname',
Expand All @@ -512,6 +534,14 @@ export const leadFields: INodeProperties[] = [
description:
'Whether the lead doesn’t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.',
},
{
displayName: 'Has Opted Out of Fax',
name: 'HasOptedOutOfFax',
type: 'boolean',
default: false,
description:
'Whether the lead doesn’t want to receive fax from Salesforce (true) or does (false). Label is Fax Opt Out.',
},
{
displayName: 'Industry',
name: 'industry',
Expand Down
2 changes: 2 additions & 0 deletions packages/nodes-base/nodes/Salesforce/LeadInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface ILead {
Company?: string;
LastName?: string;
Email?: string;
Fax?: number;
City?: string;
Phone?: string;
State?: string;
Expand All @@ -25,4 +26,5 @@ export interface ILead {
NumberOfEmployees?: number;
MobilePhone?: string;
HasOptedOutOfEmail?: boolean;
HasOptedOutOfFax?: boolean;
}
12 changes: 12 additions & 0 deletions packages/nodes-base/nodes/Salesforce/Salesforce.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,9 @@ export class Salesforce implements INodeType {
if (additionalFields.hasOptedOutOfEmail !== undefined) {
body.HasOptedOutOfEmail = additionalFields.hasOptedOutOfEmail as boolean;
}
if (additionalFields.hasOptedOutOfFax !== undefined) {
body.HasOptedOutOfFax = additionalFields.hasOptedOutOfFax as boolean;
}
if (additionalFields.email !== undefined) {
body.Email = additionalFields.email as string;
}
Expand Down Expand Up @@ -1123,6 +1126,9 @@ export class Salesforce implements INodeType {
if (additionalFields.industry !== undefined) {
body.Industry = additionalFields.industry as string;
}
if (additionalFields.fax !== undefined) {
body.Fax = additionalFields.fax as number;
}
if (additionalFields.firstname !== undefined) {
body.FirstName = additionalFields.firstname as string;
}
Expand Down Expand Up @@ -1190,6 +1196,9 @@ export class Salesforce implements INodeType {
if (updateFields.hasOptedOutOfEmail !== undefined) {
body.HasOptedOutOfEmail = updateFields.hasOptedOutOfEmail as boolean;
}
if (updateFields.hasOptedOutOfFax !== undefined) {
body.hasOptedOutOfFax = updateFields.hasOptedOutOfFax as boolean;
}
if (updateFields.lastname !== undefined) {
body.LastName = updateFields.lastname as string;
}
Expand Down Expand Up @@ -1238,6 +1247,9 @@ export class Salesforce implements INodeType {
if (updateFields.firstname !== undefined) {
body.FirstName = updateFields.firstname as string;
}
if (updateFields.fax !== undefined) {
body.Fax = updateFields.fax as number;
}
if (updateFields.leadSource !== undefined) {
body.LeadSource = updateFields.leadSource as string;
}
Expand Down

0 comments on commit 01f875a

Please sign in to comment.