From 46b7e6169537e09b9e40c9fba6ca2a096232e0a0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 29 May 2026 17:56:43 +0000 Subject: [PATCH] Wire Formspree endpoint and switch form to FormData submission Sets FORM_ENDPOINT to the live Formspree URL and changes the fetch body from JSON.stringify to a FormData object so Formspree parses fields correctly. Drops the now-invalid Content-Type: application/json header while keeping Accept: application/json. _subject is appended directly to the FormData. Branded success state and all other page content unchanged. https://claude.ai/code/session_01UvxyYfFKojskoSWTfeZ7Vj --- orders.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/orders.html b/orders.html index ee3c469..57e8008 100644 --- a/orders.html +++ b/orders.html @@ -250,7 +250,7 @@ html[lang="ko"] em { font-style: normal; color: var(--gold); font-weight: 500; } // 3. Replace the empty string below with that URL. // Until this is set, the form submits to a friendly "not configured" message. // ──────────────────────────────────────────────────────────────── -const FORM_ENDPOINT = ''; +const FORM_ENDPOINT = 'https://formspree.io/f/xojbbdzv'; (function() { const form = document.getElementById('orderForm'); @@ -286,17 +286,15 @@ const FORM_ENDPOINT = ''; } const data = new FormData(form); - const payload = {}; - data.forEach((v, k) => { payload[k] = v; }); - payload._subject = 'New order — ' + (payload.name || 'unknown') + ' · ' + (payload.fulfillment || ''); + data.append('_subject', 'New order — ' + (data.get('name') || 'unknown') + ' · ' + (data.get('fulfillment') || '')); submitBtn.disabled = true; submitBtn.textContent = 'Sending…'; fetch(FORM_ENDPOINT, { method: 'POST', - headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, - body: JSON.stringify(payload) + headers: { 'Accept': 'application/json' }, + body: data }).then(function(r) { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json().catch(() => ({}));