1272: wire up form to pardot - explore account engagement api#801
Closed
1272: wire up form to pardot - explore account engagement api#801
Conversation
Test coverage89.02% line coverage reported by SimpleCov. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue: 1272
Explore Account Engagement API for Subscription
Overview
This PR explores using the Account Engagement API (Pardot) for handling subscriptions via
editor-api.To run this locally, you may need to enable caching:
This is an exploration to validate the approach. To make this production-ready, we would still need to consider:
Key Differences vs Form Handler
Different data flow in Pardot
This approach updates prospects directly via the API. The data may not appear in the same place as Form Handler submissions.
Reporting considerations
API-driven updates may not show up in “Form Handler submissions” views. We need to confirm where this data lives and that marketing can still use it effectively.
Server-to-server integration
Everything stays backend-driven, using a cleaner and more controlled integration pattern.
Cleaner success/failure handling
API responses are easier to interpret compared to Form Handler redirects.
How to Test (Postman)
Request
Headers:
Body (raw JSON):
{ "subscription": { "email": "teacher@example.com", "test_opt_in": true, "privacy_policy": true } }Expected Responses
200 OK→ valid request, provider accepted422 Unprocessable Content→ validation error503 Service Unavailable→ provider unavailable / not configured502 Bad Gateway→ provider response rejected or unclearInvalid Example
{ "subscription": { "email": "bad-email", "test_opt_in": true, "privacy_policy": false } }Pardot Setup
API-Based Subscription Integration
This integration ensures subscription data is captured in a usable format within Pardot.
The workflow should be confirmed with the marketing team before implementation.
1. Payload Contract
The
editor-apiexpects:email(required)test_opt_in(boolean)privacy_policy(boolean — must be true)2. Pardot Admin — Setup & Provide
A) Fields
Confirm these fields exist and are API-writable:
email(standard Prospect field)test_opt_in(custom field — API name must be exactlytest_opt_in)privacy_policy(custom field — API name must be exactlyprivacy_policy)Also share any validation rules or defaults that could block writes.
B) Newsletter List
Provide:
C) Auth & Config (Required per environment)
Provide for test/POC:
PARDOT_AUTH_URLPARDOT_CLIENT_IDPARDOT_CLIENT_SECRET(securely)PARDOT_AUTH_SCOPE(if required)PARDOT_API_SUBSCRIPTION_URLPARDOT_BUSINESS_UNIT_IDD) Permissions
Confirm the integration user can:
email,test_opt_in,privacy_policyE) Setup Confirmation
Confirm:
3. Developer — Implementation
A) Environment Config
B) Field & List Mapping
C) Auth Verification
D) End-to-End Success Case
Submit a valid request and verify in Pardot:
test_opt_insaved correctlyprivacy_policysaved correctlyE) Failure Cases
TODO
Define environment setup: