Add mailing list signup form (email only) POST to /mailing webhook

This commit is contained in:
Hermes Agent
2026-08-07 21:16:31 +00:00
parent a56b338929
commit ed8e134ee6
+30
View File
@@ -238,6 +238,36 @@ function blogSearch(q) {
renderBlog();
</script>
<!-- ===== MAILING LIST ===== -->
<section style="padding:60px 0;background:#f1f5f9;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;">
<div class="container">
<div class="max-w-2xl mx-auto text-center">
<h2 style="font-size:clamp(1.25rem,2vw,1.5rem);font-weight:700;line-height:1.2;letter-spacing:-0.02em;color:#0f172a;margin-bottom:8px;">Recibe nuestro brief semanal</h2>
<p style="color:#64748b;font-size:0.9375rem;line-height:1.7;margin-bottom:24px;max-width:440px;margin-left:auto;margin-right:auto;">Resumen semanal del ecosistema Odoo directamente en tu correo.</p>
<form id="mailingForm" style="display:flex;gap:12px;max-width:440px;margin:0 auto;">
<input type="email" id="mailEmail" placeholder="tu@email.com" required style="flex:1;padding:14px 18px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;font-family:'Inter',sans-serif;font-size:0.9375rem;color:#0f172a;outline:none;transition:border-color 0.2s;" onfocus="this.style.borderColor='#4338ca'" onblur="this.style.borderColor='#e2e8f0'">
<button type="submit" class="btn-primary" style="white-space:nowrap;padding:14px 28px;">Suscribirme</button>
</form>
<p style="color:#94a3b8;font-size:0.8125rem;margin-top:12px;">Sin spam. Solo contenido útil para tu proyecto Odoo.</p>
</div>
</div>
</section>
<script>
document.getElementById('mailingForm').addEventListener('submit', async function(e) {
e.preventDefault();
const btn = this.querySelector('button');
btn.innerHTML = 'Enviando...'; btn.disabled = true;
try {
await fetch('https://n8n.odoo4projects.com/webhook/odoo-expertos/mailing', {
method: 'POST', headers: {'Content-Type':'application/json'},
body: JSON.stringify({email: document.getElementById('mailEmail').value})
});
} catch(e) {}
this.innerHTML = '<div style="padding:12px 0;"><span style="color:#10b981;font-weight:600;font-size:0.9375rem;">Gracias por suscribirte. Recibirás nuestro próximo brief.</span></div>';
});
</script>
<!-- ===== EXPERT MARKET ===== -->
<section id="expertos" style="padding:100px 0;background:#f1f5f9;border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;">
<div class="container">