fix(worker): replace Forms API submission with CRM API direct #5

Merged
serge merged 1 commits from fix/worker-crm-api-direct into main 2026-05-07 16:10:11 +03:00

1 Commits

Author SHA1 Message Date
Serge RAKOTO HARRY-NAIVO
a2dd183b79 fix(worker): replace Forms API submission with CRM API direct
Forms API (api.hsforms.com/submissions/v3/integration/submit/...) can
return 200 OK without actually creating a contact in HubSpot \xe2\x80\x94 silent
failures triggered by anti-spam filters, form configuration, or whatever
state the form GUID was left in.

Symptom in production: E2E flow completes (welcome email sent with
ref MVA-005), but contact is never created in HubSpot CRM. Reproduced
with serge+test1@mind4solutions.com on 2026-05-07.

Fix: switch to direct CRM API POST /crm/v3/objects/contacts which is
deterministic (= returns 409 if exists, error otherwise). Falls back to
PATCH on 409 to handle duplicate-email reinscriptions.

Refs: WordPress \xe2\x86\x92 static migration, post-Phase F bugfix.
2026-05-07 15:10:03 +02:00