Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions assets/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,20 @@ document.querySelector('[data-view-toggle]').addEventListener('click', (event) =

document.querySelector('[data-newsletter-form]').addEventListener('submit', async (event) => {
event.preventDefault();
const email = event.currentTarget.querySelector('input[type="email"]').value;
const input = event.currentTarget.querySelector('input[type="email"]');
const email = input.value.trim();
if (!email) return;

await window.FormaIntegrations?.saveNewsletter?.(email);
window.FormaIntegrations?.trackEvent('newsletter_signup', { email });
document.querySelector('[data-newsletter-message]').textContent = 'Listo. Te avisaremos del próximo drop privado.';

const target = 'feispla@hotmail.com';
const subject = encodeURIComponent('Nuevo registro de newsletter FORMA');
const body = encodeURIComponent(`Correo del cliente: ${email}`);
window.location.href = `mailto:${target}?subject=${subject}&body=${body}`;

document.querySelector('[data-newsletter-message]').textContent = 'Listo. Abrimos tu app de correo para enviar el registro.';
event.currentTarget.reset();
});

modal.addEventListener('click', (event) => {
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ <h2>Lista para Shopify, Supabase, Chatbase, GitHub AI y Vercel.</h2>
<div>
<a class="brand" href="#inicio"><span class="brand-mark">F</span><span>FORMA</span></a>
<p>Un e-commerce editorial construido para vender productos premium con claridad, confianza y estilo.</p>
<p><strong>Contacto comercial:</strong> FORMA Ventas · <a href="mailto:feispla@hotmail.com">feispla@hotmail.com</a></p>
</div>
<form class="newsletter" data-newsletter-form>
<label for="email-newsletter">Recibe drops y descuentos privados</label>
Expand Down
Loading