Compare commits

..

No commits in common. "c75399a4318806b417a41193a1ccde1402298a16" and "e86a7c33eac5b8df5418bd82f9bf634e2a69516c" have entirely different histories.

1 changed files with 16 additions and 21 deletions

View File

@ -80,7 +80,6 @@ export async function sendEmailCf(data: Record<string, string>, to: string, type
const apiToken = import.meta.env.CLOUDFLARE_API_TOKEN; const apiToken = import.meta.env.CLOUDFLARE_API_TOKEN;
const accountId = import.meta.env.CLOUDFLARE_ACCOUNT_ID; const accountId = import.meta.env.CLOUDFLARE_ACCOUNT_ID;
try {
const client = new Cloudflare({ apiToken }); const client = new Cloudflare({ apiToken });
const { subject } = TEMPLATE_URLS[type]; const { subject } = TEMPLATE_URLS[type];
const rawHtml = await fetchTemplate(type); const rawHtml = await fetchTemplate(type);
@ -100,10 +99,6 @@ export async function sendEmailCf(data: Record<string, string>, to: string, type
console.error("Cloudflare email not delivered", response); console.error("Cloudflare email not delivered", response);
throw new Error("El correo no fue entregado"); throw new Error("El correo no fue entregado");
} }
} catch (error) {
console.error("Cloudflare email failed, fallback a n8n:", error);
await sendEmail(data, to, type);
}
} }
// ═══════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════