Skip to content

Commit 19f892a

Browse files
Merge pull request #19 from PrimeBuild-pc/busy-keller
fix: add hardcoded fallback values for email config
2 parents 3b4b1fe + 62f6a16 commit 19f892a

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

functions/contact.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export const onRequestPost = async (context) => {
8484
}
8585

8686
// Mail sending (Resend)
87-
const mailTo = env.MAIL_TO;
88-
const resendApiKey = env.RESEND_API_KEY;
87+
const mailTo = env.MAIL_TO || 'primebuild.official@gmail.com';
88+
const resendApiKey = env.RESEND_API_KEY || 're_7sPYjLLo_9tiaHtp6EyqwZmo1wEpC3uYE';
8989

9090
if (!mailTo) {
9191
console.warn('MAIL_TO missing – skipping send.');
@@ -97,7 +97,7 @@ export const onRequestPost = async (context) => {
9797
return new Response(JSON.stringify({ success: true, warning: 'RESEND_API_KEY missing' }), { status: 200, headers: baseHeaders });
9898
}
9999

100-
const fromEmail = env.MAIL_FROM || 'onboarding@resend.dev';
100+
const fromEmail = env.MAIL_FROM || 'noreply@primebuild.website';
101101
const prefix = env.MAIL_SUBJECT_PREFIX ? env.MAIL_SUBJECT_PREFIX.trim() + ' ' : '';
102102
const html =
103103
`<p><strong>Nome:</strong> ${name}</p>

wrangler.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Cloudflare Pages configuration
2+
name = "website"
3+
compatibility_date = "2024-01-01"
4+
5+
[vars]
6+
MAIL_TO = "primebuild.official@gmail.com"
7+
MAIL_FROM = "noreply@primebuild.website"
8+
DEBUG = "1"

0 commit comments

Comments
 (0)