feat(Salesforce Node): Add HasOptedOutOfEmail field to contact resource#28259
feat(Salesforce Node): Add HasOptedOutOfEmail field to contact resource#28259colons-litzmann wants to merge 2 commits inton8n-io:masterfrom
Conversation
There was a problem hiding this comment.
No issues found across 5 files
Architecture diagram
sequenceDiagram
participant User as n8n UI / Node Editor
participant Node as Salesforce Node Execution
participant SF as Salesforce REST API
Note over User,SF: Contact Create/Update Flow
User->>Node: Select Resource: Contact / Operation: Create or Update
Node-->>User: Load field definitions (ContactDescription.ts)
Note right of User: NEW: Display 'Has Opted Out of Email' toggle
User->>Node: Input data (e.g., hasOptedOutOfEmail: true)
Node->>Node: Process 'additionalFields' or 'updateFields'
Note right of Node: NEW: Map 'hasOptedOutOfEmail' to<br/>API field 'HasOptedOutOfEmail'
Node->>SF: POST/PATCH /services/data/vXX.X/sobjects/Contact
Note right of SF: Payload includes:<br/>{ "HasOptedOutOfEmail": true, ... }
alt Success Path
SF-->>Node: 201 Created / 204 No Content
Node-->>User: Return Contact object
else Error Path
SF-->>Node: 400 Bad Request (e.g. Invalid Field)
Node-->>User: Throw NodeApiError
end
|
Hey @colons-litzmann, Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
Summary
In a previous pull request from 2023 the HasOptedOutOfEmail field has been added to the Lead Object since it was missing, but it was still missing on the Contact Object.
Related Linear tickets, Github issues, and Community forum posts
#5235
https://community.n8n.io/t/there-is-no-email-opt-out-field-in-the-saleforce-create-lead/18616/9
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)