Pre-fill email from URL on checkout and compliance checker
Email passes through the full funnel: campaign email (?email=) → compliance checker → order page. Reduces friction for campaign recipients who would otherwise have to type their email manually. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b91e76e44c
commit
fdbed5c097
2 changed files with 7 additions and 2 deletions
|
|
@ -225,8 +225,9 @@ import Base from "../../layouts/Base.astro";
|
|||
// Race condition guard — cancel prior fetch when new one starts
|
||||
let currentController = null;
|
||||
|
||||
// Promo code passthrough from URL (e.g. ?code=MEMORIAL25)
|
||||
// Promo code and email passthrough from URL (e.g. ?code=MEMORIAL25&email=user@co.com)
|
||||
let urlPromoCode = "";
|
||||
let urlEmail = "";
|
||||
|
||||
// --- Name search ---
|
||||
nameSearchBtn?.addEventListener("click", runNameSearch);
|
||||
|
|
@ -1029,7 +1030,7 @@ import Base from "../../layouts/Base.astro";
|
|||
// Update link
|
||||
const btn = document.getElementById("get-started-btn");
|
||||
if (btn) {
|
||||
btn.href = `/order/fcc-compliance?services=${selectedIds.join(",")}&frn=${frn}${urlPromoCode ? "&code=" + encodeURIComponent(urlPromoCode) : ""}`;
|
||||
btn.href = `/order/fcc-compliance?services=${selectedIds.join(",")}&frn=${frn}${urlPromoCode ? "&code=" + encodeURIComponent(urlPromoCode) : ""}${urlEmail ? "&email=" + encodeURIComponent(urlEmail) : ""}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1134,6 +1135,7 @@ import Base from "../../layouts/Base.astro";
|
|||
const frn = params.get("frn");
|
||||
const entity = params.get("entity");
|
||||
urlPromoCode = params.get("code") || params.get("promo") || "";
|
||||
urlEmail = params.get("email") || "";
|
||||
|
||||
if (frn) {
|
||||
frnInput.value = frn;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue