refactor: simplify inquiryType handling in contact forms

- Removed 'other' option from inquiryType in ContactFormData interfaces across contact form and API.
- Updated email recipient logic to use a single variable for clarity.
- Adjusted related components to reflect the changes in inquiryType options.
This commit is contained in:
Mauricio Siu
2025-12-15 15:01:42 -06:00
parent 47bd1ccc79
commit 91ef4dcb82
3 changed files with 11 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ import { NextResponse } from "next/server";
import { Resend } from "resend";
interface ContactFormData {
inquiryType: "support" | "sales" | "other";
inquiryType: "support" | "sales";
firstName: string;
lastName: string;
email: string;
@@ -107,12 +107,14 @@ Sent from Dokploy website contact form
`.trim();
// Send email to Dokploy team
const recipients =
body.inquiryType === "sales"
? ["sales@dokploy.com", "contact@dokploy.com"]
: ["support@dokploy.com"];
await resend.emails.send({
from: "Dokploy Contact Form <noreply@emails.dokploy.com>",
to:
body.inquiryType === "sales"
? ["sales@dokploy.com", "contact@dokploy.com"]
: ["contact@dokploy.com"],
to: recipients,
subject: emailSubject,
text: emailBody,
replyTo: body.email,