From 9a1554177158e7a44ab1ed1f5649060917d535b4 Mon Sep 17 00:00:00 2001 From: Scott Scoble Date: Wed, 6 May 2026 20:21:44 -0700 Subject: [PATCH] Replace mailto: form submission with LinkedIn redirect (refs #82) mailto: is bad UX - opens desktop email client most people don't have configured. Forms now validate, show success message, then redirect to LinkedIn. Removed spinner element and mailto: logic entirely. --- src/components/Form/SharedForm.astro | 42 ++++++++-------------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/src/components/Form/SharedForm.astro b/src/components/Form/SharedForm.astro index cf689cc..c83e69b 100644 --- a/src/components/Form/SharedForm.astro +++ b/src/components/Form/SharedForm.astro @@ -110,16 +110,15 @@ const topicParam = Astro.url.searchParams.get('topic'); ))} @@ -132,41 +131,33 @@ const topicParam = Astro.url.searchParams.get('topic'); const errorEl = container.querySelector('.form-error'); const submitBtn = form.querySelector('.form-submit'); const submitText = submitBtn.querySelector('.submit-text'); - const submitSpinner = submitBtn.querySelector('.submit-spinner'); form.addEventListener('submit', async (e) => { e.preventDefault(); submitBtn.disabled = true; - submitText.textContent = 'Sending...'; - submitSpinner.style.display = ''; + submitText.textContent = 'Redirecting...'; errorEl.style.display = 'none'; errorEl.textContent = ''; - const formData = new FormData(form); - formData.append('form_type', type); - try { - // Construct mailto link with form data - const data = Object.fromEntries(formData.entries()); - const subject = encodeURIComponent(`${type} inquiry from ${data.name || data.email}`); - const body = encodeURIComponent( - Object.entries(data).map(([k, v]) => `${k}: ${v}`).join('\n') - ); - window.location.href = `mailto:scott@scoble.me?subject=${subject}&body=${body}`; - + // Show success message briefly, then redirect to LinkedIn form.style.display = 'none'; successEl.style.display = ''; - // Umami tracking + // Track with Umami if available if (window.umami) { window.umami.track('form_submitted', { type, success: true }); } + + // Redirect to LinkedIn after a brief pause + setTimeout(() => { + window.location.href = 'https://linkedin.com/in/scottscoble'; + }, 1000); } catch (err) { errorEl.textContent = err.message; errorEl.style.display = ''; submitBtn.disabled = false; - submitText.textContent = type === 'waitlist' ? 'Join Waitlist' : 'Send Message'; - submitSpinner.style.display = 'none'; + submitText.textContent = type === 'waitlist' ? 'Join Waitlist' : 'Connect on LinkedIn'; } }); @@ -238,15 +229,6 @@ const topicParam = Astro.url.searchParams.get('topic'); cursor: not-allowed; } - .submit-spinner { - width: 16px; - height: 16px; - border: 2px solid white; - border-top-color: transparent; - border-radius: 50%; - animation: spin 0.75s linear infinite; - } - .form-error { background: #dc2626; color: white;