From a4cae16a50d56dce980e8058ca802e4453348c98 Mon Sep 17 00:00:00 2001 From: esteban Date: Sun, 2 Aug 2026 11:44:26 -0500 Subject: [PATCH 1/4] fix send --- src/pages/api/lib/email.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/api/lib/email.ts b/src/pages/api/lib/email.ts index c825b94..eb73b7b 100644 --- a/src/pages/api/lib/email.ts +++ b/src/pages/api/lib/email.ts @@ -95,8 +95,7 @@ export async function sendEmailCf(data: Record, to: string, type text, }); - const deliveredOrQueued = [...response.delivered, ...response.queued]; - if (!deliveredOrQueued.includes(to) || response.permanent_bounces.includes(to)) { + if (!response.delivered) { console.error("Cloudflare email not delivered", response); throw new Error("El correo no fue entregado"); } -- 2.39.5 From 34230624ce6f29bebd3d4fbfa4fc36e5db932359 Mon Sep 17 00:00:00 2001 From: David Ascanio Date: Sun, 2 Aug 2026 13:45:42 -0300 Subject: [PATCH 2/4] Fix responsive text wrapping in values section titles Replace break-all (which sliced words at arbitrary characters) with word-aware wrapping, add missing min-w-0 that let one grid column overflow, and tune the title font-size breakpoints so headings never fracture mid-word in the tight column widths between lg and 2xl. --- src/components/section/ColumnsSection.astro | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/section/ColumnsSection.astro b/src/components/section/ColumnsSection.astro index 453aeeb..08cea0e 100644 --- a/src/components/section/ColumnsSection.astro +++ b/src/components/section/ColumnsSection.astro @@ -9,17 +9,17 @@ const { props } = Astro.props;
-
-

{tl("values.justice.title")}

+
+

{tl("values.justice.title")}

{tl("values.justice.text")}

-
- +
+
-

{tl("values.integrity.title")}

+

{tl("values.integrity.title")}

{tl("values.integrity.text")}

@@ -28,17 +28,17 @@ const { props } = Astro.props;
-
-

{tl("values.service.title")}

-

{tl("values.service.text")}

+
+

{tl("values.service.title")}

+

{tl("values.service.text")}

-
-

{tl("values.excellence.title")}

-

{tl("values.excellence.text")}

+
+

{tl("values.excellence.title")}

+

{tl("values.excellence.text")}

-
-

{tl("values.dialogue.title")}

-

{tl("values.dialogue.text")}

+
+

{tl("values.dialogue.title")}

+

{tl("values.dialogue.text")}

-- 2.39.5 From 9aa0105fcab1baa2892a18db52e53af552583e6c Mon Sep 17 00:00:00 2001 From: David Ascanio Date: Sun, 2 Aug 2026 13:57:48 -0300 Subject: [PATCH 3/4] emails cloudflare --- src/pages/api/emailPostulacion/send.ts | 39 ++++---------------------- src/pages/api/lib/email.ts | 7 ++--- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/src/pages/api/emailPostulacion/send.ts b/src/pages/api/emailPostulacion/send.ts index 72ec10d..0e3d154 100644 --- a/src/pages/api/emailPostulacion/send.ts +++ b/src/pages/api/emailPostulacion/send.ts @@ -1,5 +1,6 @@ import type { APIRoute } from "astro"; import { appendToSheet, emailExists } from "../lib/googleSheets"; +import { sendEmailCf } from "../lib/email"; export const prerender = false; export const POST: APIRoute = async ({ request }) => { @@ -29,17 +30,6 @@ export const POST: APIRoute = async ({ request }) => { }) } - const dataSend = { - nombres, - apellidos, - pais, - lugar, - direccion, - telefono, - email - }; - const emailApiKey = import.meta.env.EMAIL_API_KEY; - const valuesForSheets = [ nombres, apellidos, @@ -51,31 +41,12 @@ export const POST: APIRoute = async ({ request }) => { new Date().toLocaleString() ]; - // 🔹 Enviar a tu backend real - const [emailResponse] = await Promise.all([ - fetch("http://155.138.215.11:3050/email/send", { - method: "POST", - headers: { - "Content-Type": "application/json", - "x-api-key": emailApiKey!, - }, - body: JSON.stringify({ - type: "CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_POSTULACION", - data: dataSend, - }), - }), - appendToSheet(valuesForSheets) // Guardar en Google Sheets + // 🔹 Enviar correo (Cloudflare) y guardar en Google Sheets + await Promise.all([ + sendEmailCf({ nombres, apellidos }, email, "CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_POSTULACION"), + appendToSheet(valuesForSheets) ]); - if (!emailResponse.ok) { - return new Response(null, { - status: 302, - headers: { - Location: "/", - }, - }); - } - // 🔹 Redirección elegante después de enviar return new Response(null, { status: 302, diff --git a/src/pages/api/lib/email.ts b/src/pages/api/lib/email.ts index c825b94..055ebf7 100644 --- a/src/pages/api/lib/email.ts +++ b/src/pages/api/lib/email.ts @@ -39,11 +39,11 @@ export async function sendEmail(data: object, to: string, type: TypeEmailData) { const TEMPLATE_URLS: Record = { CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_POSTULACION: { subject: "Confirmación de inscripción al voluntariado", - url: "https://pub-910ed90860804520b9202194cf43c0a6.r2.dev/centro_del_reino_paz_y_justicia_postulacion_user.html", + url: "https://assets.centrodelreinodepazyjusticia.com/centro_del_reino_paz_y_justicia_postulacion_user.html", }, CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_INFO: { subject: "Notificación de contacto institucional", - url: "https://pub-910ed90860804520b9202194cf43c0a6.r2.dev/centro_del_reino_paz_y_justicia_info.html", + url: "https://assets.centrodelreinodepazyjusticia.com/centro_del_reino_paz_y_justicia_info.html", }, }; @@ -95,8 +95,7 @@ export async function sendEmailCf(data: Record, to: string, type text, }); - const deliveredOrQueued = [...response.delivered, ...response.queued]; - if (!deliveredOrQueued.includes(to) || response.permanent_bounces.includes(to)) { + if (response.permanent_bounces.includes(to)) { console.error("Cloudflare email not delivered", response); throw new Error("El correo no fue entregado"); } -- 2.39.5 From 5dc873580ee8b322416caa1eb9e309262d5cb1b5 Mon Sep 17 00:00:00 2001 From: David Ascanio Date: Sun, 2 Aug 2026 14:01:42 -0300 Subject: [PATCH 4/4] email contacto cloudflare --- src/pages/api/emailInfo/send.ts | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/pages/api/emailInfo/send.ts b/src/pages/api/emailInfo/send.ts index 858c543..3d555b6 100644 --- a/src/pages/api/emailInfo/send.ts +++ b/src/pages/api/emailInfo/send.ts @@ -1,5 +1,6 @@ import type { APIRoute } from "astro"; import { prisma } from "../lib/prisma"; +import { sendEmailCf } from "../lib/email"; export const prerender = false; @@ -64,32 +65,11 @@ export const POST: APIRoute = async ({ request }) => { }, }); } - const emailApiKey = import.meta.env.EMAIL_API_KEY; - - const emailResponse = await fetch("https://flows2.carpa.com/webhook/email/send", { - method: "POST", - headers: { - "Content-Type": "application/json", - "x-api-key": emailApiKey!, - }, - body: JSON.stringify({ - type: "CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_INFO", - data: { - nombre, - email, - mensaje, - senderName : "Centro del Reino de Paz y Justicia", - }, - }), - }); - - if (!emailResponse.ok) { - console.error("Error enviando correo"); - return new Response( - JSON.stringify({ error: "Error en servicio de correo" }), - { status: 500 } - ); - } + await sendEmailCf( + { nombre, email, mensaje }, + "joseperez@centrodelreinodepazyjusticia.com", + "CENTRO_DEL_REINO_PAZ_Y_JUSTICIA_INFO", + ); return new Response(null, { status: 302, -- 2.39.5