File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
apps/website/app/api/contact Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ import type { NextRequest } from "next/server";
22import { NextResponse } from "next/server" ;
33import { Resend } from "resend" ;
44
5- const resend = new Resend ( process . env . RESEND_API_KEY || "" ) ;
6-
75interface ContactFormData {
86 inquiryType : "support" | "sales" | "other" ;
97 name : string ;
@@ -14,6 +12,17 @@ interface ContactFormData {
1412
1513export async function POST ( request : NextRequest ) {
1614 try {
15+ // Initialize Resend with API key check
16+ const apiKey = process . env . RESEND_API_KEY ;
17+ if ( ! apiKey ) {
18+ console . error ( "RESEND_API_KEY is not configured" ) ;
19+ return NextResponse . json (
20+ { error : "Email service not configured" } ,
21+ { status : 500 } ,
22+ ) ;
23+ }
24+
25+ const resend = new Resend ( apiKey ) ;
1726 const body : ContactFormData = await request . json ( ) ;
1827
1928 // Validate required fields
You can’t perform that action at this time.
0 commit comments