From 1611ca2c2c097ce10fc2ed8e1b19c22acf808d25 Mon Sep 17 00:00:00 2001 From: Brendan Samek Date: Fri, 16 Oct 2026 12:46:24 -0600 Subject: [PATCH] Write volunteer sign-ups in CJPAC's new intake sheet format Renames the Sheet columns to match CJPAC's intake sheet, writes Yes to "Consent to share with CJPAC", and stops writing City, Details added at, Source, Medium, Campaign and Partner, which the new sheet has no columns for. Co-Authored-By: Claude Opus 5.5 --- src/app/api/volunteer/details/route.ts | 5 ++--- src/app/api/volunteer/route.ts | 16 ++++++--------- src/app/toronto/volunteer/build-the-vote.ts | 22 ++++++--------------- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/app/api/volunteer/details/route.ts b/src/app/api/volunteer/details/route.ts index 284badf..0041664 100644 --- a/src/app/api/volunteer/details/route.ts +++ b/src/app/api/volunteer/details/route.ts @@ -7,7 +7,7 @@ import { SHEET_COLUMNS, SHEET_TAB, } from "@/app/toronto/volunteer/build-the-vote"; -import { sheetTimestamp, upsertSheetRow } from "@/lib/google-sheet"; +import { upsertSheetRow } from "@/lib/google-sheet"; // Build the Vote step 2: optional details, added to the volunteer's row in the // Sheet shared with CJPAC. The row is found by the email step 1's response put @@ -36,9 +36,8 @@ export async function POST(req: NextRequest) { email, values: { Availability: availability.join(", "), - "Mayoral candidate": mayoral, + "Mayoral Candidate": mayoral, Issues: issues, - "Details added at": sheetTimestamp(), }, }); diff --git a/src/app/api/volunteer/route.ts b/src/app/api/volunteer/route.ts index 6408060..760243f 100644 --- a/src/app/api/volunteer/route.ts +++ b/src/app/api/volunteer/route.ts @@ -3,7 +3,6 @@ import { NextRequest, NextResponse } from "next/server"; import { DETAILS_API_PATH, EMAIL_COOKIE, - PARTNER_SOURCE, SHEET_COLUMNS, SHEET_TAB, } from "@/app/toronto/volunteer/build-the-vote"; @@ -57,16 +56,13 @@ export async function POST(req: NextRequest) { columns: SHEET_COLUMNS, email, values: { - "Signed up at": sheetTimestamp(), - "First name": firstName, - "Last name": lastName, + "Submitted At": sheetTimestamp(), + "First Name": firstName, + "Last Name": lastName, Phone: phone, - City: city, - "Postal code": postalCode, - Source: str(body.utm_source, 100), - Medium: str(body.utm_medium, 100), - Campaign: str(body.utm_campaign, 100), - Partner: PARTNER_SOURCE, + "Postal Code": postalCode, + // Submitting the form is consent; the form says so above the button. + "Consent to share with CJPAC": "Yes", }, }); diff --git a/src/app/toronto/volunteer/build-the-vote.ts b/src/app/toronto/volunteer/build-the-vote.ts index be5bfed..440b7ac 100644 --- a/src/app/toronto/volunteer/build-the-vote.ts +++ b/src/app/toronto/volunteer/build-the-vote.ts @@ -9,31 +9,21 @@ export const VOLUNTEER_PATH = "/toronto/volunteer"; export const STEP_2_PATH = `${VOLUNTEER_PATH}/step-2`; export const THANKS_PATH = `${VOLUNTEER_PATH}/thanks`; -/** Written to every row's Partner column so CJPAC can tell our sign-ups from - * those of their other partners. Not the visitor's own utm_source, which goes - * in the Source column. */ -export const PARTNER_SOURCE = "buildcanada"; - /** The tab of CJPAC's Sheet that sign-ups are written to, and the header row * it starts with if empty. Values are matched to columns by these names, so * renaming one in the Sheet means renaming it here too. */ export const SHEET_TAB = "Sign-ups"; export const SHEET_COLUMNS = [ - "Signed up at", - "First name", - "Last name", + "Submitted At", + "First Name", + "Last Name", "Email", "Phone", - "City", - "Postal code", + "Postal Code", "Availability", - "Mayoral candidate", + "Mayoral Candidate", "Issues", - "Details added at", - "Source", - "Medium", - "Campaign", - "Partner", + "Consent to share with CJPAC", ] as const; /** Set by step 1's API response so step 2 can add to the right row without