Skip to content

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"| POD
  • 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 by lead_id. No second Podium text — the customer already got one.
  • A complete arriving with no prior partial creates a full lead. Posts are fire-and-forget, so order isn’t guaranteed — the dashboard merges payloads only on complete so 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 daylead_id is client-generated and replayable, so the public endpoint must not mutate worked leads.
  • 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-line name.

The dashboard captures the extras (VIN, insurance company, uses-insurance) and shows a Partial / Complete “Form” badge on the lead.

Walnut Creek shipped first (end-to-end verified 2026-07-07). Gateway and A Plus are near-verbatim copies. For each site:

  1. 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 .env override.
  2. Port QuoteForm.astro + step-aware functions/api/notify.js + the salesDashboard / notify blocks in site.ts from the Walnut Creek repo. Delete the old quote-form.js / form-handler.js.
  3. Set Resend + Podium env vars on the site’s Cloudflare Pages project, then redeploy (env vars only bind on a new deployment).
  4. 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).
  5. Owner approves → merge stagingmain (production cutover; Zapier stops receiving).
  6. Cleanup: delete test leads from the dashboard; after the full fleet is rolled out, remove the *.pages.dev / staging hosts from the origin allowlist.