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(() => ({}));