Skip to content

Commit 74ecb03

Browse files
committed
fix(web): log contact email delivery failures
1 parent e4ec99b commit 74ecb03

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

apps/web/src/app/(marketing)/contact/actions.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)