Skip to content

Commit fada052

Browse files
committed
fix: adjust email recipient logic based on inquiry type in contact form
1 parent 447ad1a commit fada052

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/website/app/api/contact/route.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { NextRequest } from "next/server";
22
import { NextResponse } from "next/server";
33
import { Resend } from "resend";
44

5-
const resend = new Resend(process.env.RESEND_API_KEY);
5+
const resend = new Resend(process.env.RESEND_API_KEY || "");
66

77
interface ContactFormData {
88
inquiryType: "support" | "sales" | "other";
@@ -61,7 +61,10 @@ Sent from Dokploy website contact form
6161
// Send email to Dokploy team
6262
await resend.emails.send({
6363
from: "Dokploy Contact Form <noreply@emails.dokploy.com>",
64-
to: ["sales@dokploy.com", "contact@dokploy.com"],
64+
to:
65+
body.inquiryType === "sales"
66+
? ["sales@dokploy.com", "contact@dokploy.com"]
67+
: ["contact@dokploy.com"],
6568
subject: emailSubject,
6669
text: emailBody,
6770
replyTo: body.email,

0 commit comments

Comments
 (0)