Skip to content

The canonical lead flow

When a customer submits a quote form on any glass marketing site, this — and only this — happens:

flowchart TD
FORM[Customer submits quote form] --> FN["/api/notify Cloudflare Function<br/>runs on the site itself"]
FN --> EMAIL[Email to the shop inbox<br/>sent via Resend]
FN --> PC[Podium contact created<br/>status: new lead]
FN --> PT["Podium welcome text<br/>uses FIRST name only"]
FORM -->|Webhook, upsert by lead_id| DB[Lead stored in the sales dashboard]
EMAIL --> TEAM[Team follows up]
PT --> TEAM
  1. There is NO Slack anywhere in this flow. Alerts are email + Podium, period. The dashboard’s Slack hook is a deliberate no-op — don’t design anything around Slack.
  2. Name is always ONE line (“First Last”) in every payload — even when the form UI has separate First/Last fields, the payload sends a combined name.
  3. The Podium welcome text uses the first name only (notify.js splits the combined name).
  4. Alerts vs storage are separate jobs: alerts = the site’s /api/notify Function (Resend email + Podium); storage = the dashboard webhook. Neither depends on the other.
  5. Zapier is retired. The sites went through a Zapier → notify cutover; the notify.enabled flag keeps a reversible fallback path, but the target state is notify-only.
  • BCB sites (SFV, Scottsdale, Bellevue, Del Mar, AGLA): single-step form with one “Full Name” field. One submit fires the whole flow above.
  • XPRO sites (Walnut Creek, Gateway, A Plus): two-step form — intentionally different, do not collapse it. See two-step forms for the partial/complete logic.
PieceWhere
Quote formQuoteForm.astro component in each site repo (config from site.ts)
Notify Functionfunctions/api/notify.js in each site repo
Resend + Podium credentialsCloudflare Pages env vars, per project
Lead storage endpointSales dashboard web-lead webhook (origin-allowlisted)
  • Cloudflare env vars only bind on a NEW deployment. Setting/changing a Pages env var does nothing until you redeploy (an empty commit works). If notify “silently does nothing,” check this first.
  • Origin allowlist lives in TWO places on the dashboard side: the config default and the prod .env override. Editing only the config is a silent no-op if the env var is set.
  • Stale Podium tokens per CF project: each Pages project carries its own Podium token. A token minted before a scope fix will 403 on contact creation while the welcome text still sends. Fix: copy the current refresh token + client credentials from a working project, remove any static access-token override, redeploy.