feat(mail): add smtp email delivery
This commit is contained in:
parent
faddaa91d0
commit
3456b04ed4
25 changed files with 529 additions and 60 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { addContactInquiry } from "@/lib/admin/store";
|
||||
import { sendContactInquiryMail } from "@/lib/mail/smtp";
|
||||
|
||||
function text(value: FormDataEntryValue | null) {
|
||||
return typeof value === "string" ? value.trim() : "";
|
||||
|
|
@ -16,7 +17,8 @@ export async function POST(request: Request) {
|
|||
return NextResponse.json({ message: "Bitte füllen Sie alle Pflichtfelder aus." }, { status: 400 });
|
||||
}
|
||||
|
||||
await addContactInquiry(form);
|
||||
const inquiry = await addContactInquiry(form);
|
||||
await sendContactInquiryMail(inquiry);
|
||||
|
||||
return NextResponse.json({
|
||||
message: "Ihre Nachricht wurde erfasst. Sie erhalten eine Rückmeldung.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue