Skip to content

Commit

Permalink
feat(Salesforce Node): Add HasOptedOutOfEmail field to lead resource (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoE105 authored Feb 1, 2023
1 parent 43b4a8a commit 59f290f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/nodes-base/nodes/Salesforce/LeadDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ export const leadFields: INodeProperties[] = [
default: '',
description: 'First name of the lead. Limited to 40 characters.',
},
{
displayName: 'Has Opted Out of Email',
name: 'hasOptedOutOfEmail',
type: 'boolean',
default: false,
description:
'Whether the lead doesn’t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.',
},
{
displayName: 'Industry',
name: 'industry',
Expand Down Expand Up @@ -496,6 +504,14 @@ export const leadFields: INodeProperties[] = [
default: '',
description: 'First name of the lead. Limited to 40 characters.',
},
{
displayName: 'Has Opted Out of Email',
name: 'hasOptedOutOfEmail',
type: 'boolean',
default: false,
description:
'Whether the lead doesn’t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.',
},
{
displayName: 'Industry',
name: 'industry',
Expand Down
1 change: 1 addition & 0 deletions packages/nodes-base/nodes/Salesforce/LeadInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export interface ILead {
IsUnreadByOwner?: boolean;
NumberOfEmployees?: number;
MobilePhone?: string;
HasOptedOutOfEmail?: boolean;
}
6 changes: 6 additions & 0 deletions packages/nodes-base/nodes/Salesforce/Salesforce.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,9 @@ export class Salesforce implements INodeType {
Company: company,
LastName: lastname,
};
if (additionalFields.hasOptedOutOfEmail !== undefined) {
body.HasOptedOutOfEmail = additionalFields.hasOptedOutOfEmail as boolean;
}
if (additionalFields.email !== undefined) {
body.Email = additionalFields.email as string;
}
Expand Down Expand Up @@ -1185,6 +1188,9 @@ export class Salesforce implements INodeType {
{ itemIndex: i },
);
}
if (updateFields.hasOptedOutOfEmail !== undefined) {
body.HasOptedOutOfEmail = updateFields.hasOptedOutOfEmail as boolean;
}
if (updateFields.lastname !== undefined) {
body.LastName = updateFields.lastname as string;
}
Expand Down

0 comments on commit 59f290f

Please sign in to comment.