From 5b663be89fe8c26f50f6eb8ef0f8982a49295530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoni=20Nu=C3=B1ez=20Romeu?= Date: Fri, 20 Mar 2026 02:57:46 +0100 Subject: [PATCH] Mail & Fixes --- src/components/BookingSection.tsx | 6 +- src/data/event-data.ts | 7 ++ ticket-template.html | 149 ++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 ticket-template.html diff --git a/src/components/BookingSection.tsx b/src/components/BookingSection.tsx index dbcf333..f1e9c8a 100644 --- a/src/components/BookingSection.tsx +++ b/src/components/BookingSection.tsx @@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from "react"; import { motion } from "framer-motion"; import { z } from "zod"; import { Button } from "@/components/ui/button"; -import { WEBHOOK_URL } from "@/data/event-data"; +import { WEBHOOK_URL, WEBHOOK_SECRET } from "@/data/event-data"; import { CheckCircle, Loader2, AlertCircle, Search } from "lucide-react"; /** @@ -135,6 +135,10 @@ const BookingSection = () => { console.log("[Booking] Sending to:", WEBHOOK_URL); const res = await fetch(WEBHOOK_URL, { method: "POST", + headers: { + "Content-Type": "application/json", + "X-Webhook-Secret": WEBHOOK_SECRET, + }, body: JSON.stringify(result.data), }); console.log("[Booking] Response status:", res.status); diff --git a/src/data/event-data.ts b/src/data/event-data.ts index 299a825..347079b 100644 --- a/src/data/event-data.ts +++ b/src/data/event-data.ts @@ -57,6 +57,13 @@ export const EVENT_INFO = { * } */ export const WEBHOOK_URL = "https://n8n.hacecalor.net/webhook/event-reservation"; +/** + * CLAVE DE AUTENTICACIÓN: + * + * Si activas "Header Auth" en n8n, asegúrate de que el nombre del header + * sea "X-Webhook-Secret" y que este valor coincida con el que pongas allí. + */ +export const WEBHOOK_SECRET = "oWkS4cAgj0LVgIbnO3cGKTePPLnRAIAa5NTvXahx5z0="; // ---- SOBRE EL EVENTO ---- export const ABOUT_EVENT = { diff --git a/ticket-template.html b/ticket-template.html new file mode 100644 index 0000000..62ac0b2 --- /dev/null +++ b/ticket-template.html @@ -0,0 +1,149 @@ + + + + + + Registro de Ticket - ZoukLambadaBCN + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ ZoukLambadaBCN +

+

+ Beach Festival 2026 +

+
+

¡Hola, {{name}}! 👋

+

+ Tu registro para el ZoukLambadaBCN Beach Festival ha sido recibido correctamente. Estamos emocionados de tenerte con nosotros este Septiembre. +

+ + + + + + + + + + + + +
+ Ticket de Referencia:
+ #{{requestId}} +
+ + + + + +
{{passType}} x{{amount}}{{price}}€
+
+

+ ⚠️ Recuerda: No se requiere pago online. El pago total de {{price}}€ se realizará directamente en el mostrador del evento. +

+
+ + +

+ 📅 04 - 07 Sept, 2026
+ 📍 Santa Susana, Barcelona +

+
+
+
+

Hi, {{name}}! 👋

+

+ Your registration for the ZoukLambadaBCN Beach Festival has been successfully received. We are excited to have you with us this September. +

+ + + + + + + + + + + + +
+ Reference Ticket:
+ #{{requestId}} +
+ + + + + +
{{passType}} x{{amount}}{{price}}€
+
+

+ ⚠️ Remember: No online payment required. The total payment of {{price}}€ will be made directly at the event's front desk. +

+
+ + +

+ 📅 04 - 07 Sept, 2026
+ 📍 Santa Susana, Barcelona +

+
+

¡Síguenos y prepárate! / Follow us and get ready!

+ + Instagram + +

+ © 2026 ZoukLambadaBCN. Todos los derechos reservados.
+ Si no realizaste este registro, por favor ignora este correo.
+ If you did not perform this registration, please ignore this email. +

+
+
+ +