feat(mail): add smtp email delivery

This commit is contained in:
Schubert Ferenc 2026-07-04 00:06:20 +02:00
parent faddaa91d0
commit 3456b04ed4
25 changed files with 529 additions and 60 deletions

View file

@ -1,5 +1,6 @@
import { NextResponse } from "next/server";
import { addRepairInquiry } from "@/lib/admin/store";
import { sendRepairInquiryMail } from "@/lib/mail/smtp";
function required(value: FormDataEntryValue | null) {
return typeof value === "string" && value.trim().length > 0;
@ -19,7 +20,8 @@ export async function POST(request: Request) {
return NextResponse.json({ message: "Bitte füllen Sie alle Pflichtfelder aus." }, { status: 400 });
}
await addRepairInquiry(form);
const inquiry = await addRepairInquiry(form);
await sendRepairInquiryMail(inquiry);
return NextResponse.json({
message: "Ihre Reparaturanfrage wurde erfasst. Sie erhalten nach Prüfung eine Rückmeldung.",