working brevo on homepage

This commit is contained in:
2025-12-08 11:41:01 -05:00
parent 2cd871b529
commit 6b0e0334b0
5 changed files with 104 additions and 40 deletions
-38
View File
@@ -1,38 +0,0 @@
// app/api/beta-signup/route.ts
import { NextResponse } from "next/server";
export async function POST(request: Request) {
try {
const { email, useCase } = await request.json();
if (!email || typeof email !== "string") {
return NextResponse.json({ error: "Email is required" }, { status: 400 });
}
// TODO: Wire this to Brevo
// - Either call Brevo's API directly from here
// - Or POST to your Spring backend which then talks to Brevo
//
// Example (pseudo):
// await fetch("https://api.brevo.com/v3/contacts", {
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// "api-key": process.env.BREVO_API_KEY!,
// },
// body: JSON.stringify({
// email,
// attributes: { USE_CASE: useCase },
// listIds: [123], // your Brevo list ID
// updateEnabled: true,
// }),
// });
console.log("New beta signup:", { email, useCase });
return NextResponse.json({ ok: true });
} catch (err) {
console.error(err);
return NextResponse.json({ error: "Server error" }, { status: 500 });
}
}