feat: settings and deploy docs
This commit is contained in:
1 parent
8b33242db1
commit
39f782057c
10 files changed
+194
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { sendMail } from "@/lib/mail";
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const body = await req.json().catch(() => ({}));
|
||||
const to = String(body.to ?? process.env.MAIL_FROM ?? "");
|
||||
if (!to) return NextResponse.json({ error: "Empfänger fehlt" }, { status: 400 });
|
||||
try {
|
||||
await sendMail(to, "Gutschein-Tracker Test-Mail", "Test-Mail vom Gutschein-Tracker: Versand funktioniert.");
|
||||
return NextResponse.json({ ok: true });
|
||||
} catch (e) {
|
||||
return NextResponse.json({ error: e instanceof Error ? e.message : String(e) }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user