XPRO two-step forms
The XPRO sites use a two-step quote form — step 1 captures contact info, step 2 captures vehicle/insurance details. It’s intentionally different from BCB’s single-step form; don’t collapse it.
flowchart TD S1[Step 1: name, phone, email] -->|submit| P1["Fires PARTIAL<br/>(client-generated lead_id)"] P1 --> E1[Email #1 to shop inbox] P1 --> POD[Podium contact + welcome text] P1 --> UP1[Dashboard lead CREATED<br/>keyed on lead_id] S1 --> S2[Step 2: vehicle, VIN, insurance, comments] S2 -->|submit| P2[Fires COMPLETE<br/>same lead_id] P2 --> E2[Email #2 with vehicle + insurance details] P2 --> UP2[Dashboard lead UPDATED<br/>same lead — no duplicate] P2 -.->|"No second Podium text"| PODThe logic
Section titled “The logic”- Step 1 (
partial) fires immediately — the lead is real as soon as we have a name and phone. Email + Podium contact + welcome text + dashboard lead, all at once. - Step 2 (
complete) sends a second email only (vehicle/insurance details) and updates the same dashboard lead bylead_id. No second Podium text — the customer already got one. - A
completearriving with no priorpartialcreates a full lead. Posts are fire-and-forget, so order isn’t guaranteed — the dashboard merges payloads only oncompleteso a late partial can’t regress the data. - The dashboard never updates a lead a rep has already claimed/closed, or anything older
than a day —
lead_idis client-generated and replayable, so the public endpoint must not mutate worked leads.
Form fields (preserve all of them)
Section titled “Form fields (preserve all of them)”- Step 1: first, last, phone (intl-tel-input, E.164), email + honeypot field.
- Step 2: city/ZIP, repair type, year, make, model, VIN/plate, uses-insurance, insurance company, comments.
- Payloads carry
lead_id,submission_status(partial/complete),form_name, and page metadata — plus the combined one-linename.
The dashboard captures the extras (VIN, insurance company, uses-insurance) and shows a Partial / Complete “Form” badge on the lead.
Rollout SOP (per site)
Section titled “Rollout SOP (per site)”Walnut Creek shipped first (end-to-end verified 2026-07-07). Gateway and A Plus are near-verbatim copies. For each site:
- Dashboard first: confirm the site’s domains (apex + www + its staging host) are in the
web-lead origin allowlist — both the config default and the prod
.envoverride. - Port
QuoteForm.astro+ step-awarefunctions/api/notify.js+ thesalesDashboard/notifyblocks insite.tsfrom the Walnut Creek repo. Delete the oldquote-form.js/form-handler.js. - Set Resend + Podium env vars on the site’s Cloudflare Pages project, then redeploy (env vars only bind on a new deployment).
- On the staging preview: submit step 1 → confirm email + Podium text + dashboard lead. Submit step 2 → confirm second email + the same lead enriched (not a duplicate).
- Owner approves → merge
staging→main(production cutover; Zapier stops receiving). - Cleanup: delete test leads from the dashboard; after the full fleet is rolled out,
remove the
*.pages.dev/ staging hosts from the origin allowlist.