Allinea il flusso contatti a info support no-reply
Completa il routing reparto con account support e aggiorna documentazione/env per usare info come fallback e no-reply come mittente tecnico. Made-with: Cursor
This commit is contained in:
@ -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=
|
||||
|
||||
11
README.md
11
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.
|
||||
|
||||
@ -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)' },
|
||||
|
||||
@ -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<string, string> = {
|
||||
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),
|
||||
|
||||
Reference in New Issue
Block a user