File tree Expand file tree Collapse file tree
apps/web/src/app/(marketing)/contact Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export async function submitContactForm(formData: FormData) {
1717 }
1818
1919 try {
20- await resend . emails . send ( {
20+ const response = await resend . emails . send ( {
2121 from : env . RESEND_FROM_EMAIL ,
2222 to : env . RESEND_TO_EMAIL ,
2323 replyTo : email ,
@@ -32,8 +32,19 @@ export async function submitContactForm(formData: FormData) {
3232 . join ( "\n" ) ,
3333 } ) ;
3434
35+ if ( response . error ) {
36+ console . error ( "Failed to send contact inquiry" , {
37+ error : response . error ,
38+ headers : response . headers ,
39+ } ) ;
40+
41+ return { error : "Something went wrong. Please try again or email us directly." } ;
42+ }
43+
3544 return { success : true } ;
36- } catch {
45+ } catch ( error ) {
46+ console . error ( "Unexpected contact inquiry error" , error ) ;
47+
3748 return { error : "Something went wrong. Please try again or email us directly." } ;
3849 }
3950}
You can’t perform that action at this time.
0 commit comments