diff --git a/.env.example b/.env.example index 47006d9..aef0b21 100644 --- a/.env.example +++ b/.env.example @@ -5,8 +5,9 @@ PUBLIC_CONTACT_TURNSTILE_SITE_KEY= CONTACT_FORM_MODE=dev CONTACT_FORM_RESEND_API_KEY= -CONTACT_FORM_FROM_EMAIL= -CONTACT_FORM_TO_EMAIL= +CONTACT_FORM_FROM_EMAIL=no-reply@nexstudio.com +CONTACT_FORM_TO_EMAIL=info@nexstudio.com +CONTACT_FORM_TO_EMAIL_SUPPORT=support@nexstudio.com CONTACT_FORM_TO_EMAIL_PRIVACY= CONTACT_FORM_TO_EMAIL_SECURITY= CONTACT_FORM_TO_EMAIL_ETHICS= diff --git a/README.md b/README.md index 7c50539..924b287 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,9 @@ Server-side (Cloudflare runtime / local `.env`): - `CONTACT_FORM_MODE` (`dev` or `live`) - `CONTACT_FORM_RESEND_API_KEY` -- `CONTACT_FORM_FROM_EMAIL` (verified sender in Resend) -- `CONTACT_FORM_TO_EMAIL` (default recipient inbox or alias) +- `CONTACT_FORM_FROM_EMAIL` (verified sender in Resend, recommended `no-reply@nexstudio.com`) +- `CONTACT_FORM_TO_EMAIL` (default recipient inbox or alias, recommended `info@nexstudio.com`) +- `CONTACT_FORM_TO_EMAIL_SUPPORT` - `CONTACT_FORM_TO_EMAIL_PRIVACY` - `CONTACT_FORM_TO_EMAIL_SECURITY` - `CONTACT_FORM_TO_EMAIL_ETHICS` @@ -86,4 +87,10 @@ Department routing: - if a department-specific env is set, the email is routed to that recipient - otherwise it falls back to `CONTACT_FORM_TO_EMAIL` +Suggested operational use: + +- `info@...` for prospects and generic clarifications (non-clients) +- `support@...` for existing customers +- `no-reply@...` as sender for newsletters and automated communications + Copy `.env.example` to `.env` for local development and configure the same keys in Cloudflare Pages/Workers for production. diff --git a/src/data/home/cta.ts b/src/data/home/cta.ts index a04ce7b..746f3a1 100644 --- a/src/data/home/cta.ts +++ b/src/data/home/cta.ts @@ -55,6 +55,7 @@ export const cta = { fieldMessage: 'message', departmentOptions: [ { value: 'general', label: 'Generale' }, + { value: 'support', label: 'Support' }, { value: 'privacy', label: 'Privacy / DPO' }, { value: 'security', label: 'Security / Incident Response' }, { value: 'ethics', label: 'Segnalazioni confidenziali (Ethics)' }, diff --git a/src/pages/api/contact.ts b/src/pages/api/contact.ts index f4f6025..f69dd38 100644 --- a/src/pages/api/contact.ts +++ b/src/pages/api/contact.ts @@ -82,6 +82,7 @@ async function sendWithResend(apiKey: string, fromEmail: string, toEmail: string function resolveDepartmentRecipient(runtimeEnv: RuntimeEnv, defaultRecipient: string, department: string): string { const normalized = department.trim().toLowerCase(); const map: Record = { + support: readEnv('CONTACT_FORM_TO_EMAIL_SUPPORT', runtimeEnv), privacy: readEnv('CONTACT_FORM_TO_EMAIL_PRIVACY', runtimeEnv), security: readEnv('CONTACT_FORM_TO_EMAIL_SECURITY', runtimeEnv), ethics: readEnv('CONTACT_FORM_TO_EMAIL_ETHICS', runtimeEnv),