Rende operativi news, runbook e routing contatti vetrina #7

Merged
javaxman merged 2 commits from feat/issue-4-contenuti-operativi into main 2026-04-27 10:20:31 +02:00
5 changed files with 135 additions and 107 deletions
Showing only changes of commit ddab32d3ef - Show all commits

View File

@ -7,10 +7,7 @@ CONTACT_FORM_MODE=dev
CONTACT_FORM_RESEND_API_KEY=
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_INFO=info@nexstudio.com
CONTACT_FORM_TO_EMAIL_PRIVACY=
CONTACT_FORM_TO_EMAIL_SECURITY=
CONTACT_FORM_TO_EMAIL_ETHICS=
CONTACT_FORM_TO_EMAIL_LEGAL=
CONTACT_FORM_TO_EMAIL_HR=
CONTACT_FORM_TO_EMAIL_CAREERS=
CONTACT_TURNSTILE_SECRET_KEY=

View File

@ -66,12 +66,9 @@ Variabili server (Cloudflare/local):
- `CONTACT_FORM_RESEND_API_KEY`
- `CONTACT_FORM_FROM_EMAIL` (consigliato: `no-reply@nexstudio.ai`)
- `CONTACT_FORM_TO_EMAIL` (default destinatario, es. `info@nexstudio.ai`)
- `CONTACT_FORM_TO_EMAIL_SUPPORT`
- `CONTACT_FORM_TO_EMAIL_INFO` (opzionale, override esplicito per area "info")
- `CONTACT_FORM_TO_EMAIL_PRIVACY`
- `CONTACT_FORM_TO_EMAIL_SECURITY`
- `CONTACT_FORM_TO_EMAIL_ETHICS`
- `CONTACT_FORM_TO_EMAIL_LEGAL`
- `CONTACT_FORM_TO_EMAIL_HR`
- `CONTACT_FORM_TO_EMAIL_CAREERS`
- `CONTACT_TURNSTILE_SECRET_KEY`
Comportamento:
@ -79,6 +76,19 @@ Comportamento:
- `dev`: accetta submit e scrive payload nei log (senza invio reale)
- `live`: valida Turnstile e invia email via Resend
Routing pubblico consigliato (portale vetrina):
- `info`: informazioni generali/commerciali
- `privacy`: richieste privacy e diritti interessato
- `careers`: candidature e collaborazioni
Indirizzi consigliati portale:
- `info@nexstudio.ai`
- `privacy@nexstudio.ai`
- `careers@nexstudio.ai`
- `no-reply@nexstudio.ai` (solo invio comunicazioni/newsletter, non destinazione inbound)
## Deploy Cloudflare
Impostazioni consigliate:

View File

@ -30,7 +30,7 @@ export const cta = {
nameLabel: 'Nome',
companyLabel: 'Azienda (opzionale)',
countryLabel: 'Paese',
departmentLabel: 'Reparto',
departmentLabel: 'Area',
emailLabel: 'Email',
messageLabel: 'Scrivi qui il tuo messaggio',
submitLabel: 'Invia messaggio',
@ -54,13 +54,9 @@ export const cta = {
fieldEmail: 'email',
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)' },
{ value: 'legal', label: 'Legal' },
{ value: 'hr', label: 'HR' },
{ value: 'info', label: 'Informazioni generali e commerciali' },
{ value: 'privacy', label: 'Privacy' },
{ value: 'careers', label: 'Careers / Collaborazioni' },
],
},
} as const;

View File

@ -82,12 +82,9 @@ 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),
info: readEnv('CONTACT_FORM_TO_EMAIL_INFO', runtimeEnv) || defaultRecipient,
privacy: readEnv('CONTACT_FORM_TO_EMAIL_PRIVACY', runtimeEnv),
security: readEnv('CONTACT_FORM_TO_EMAIL_SECURITY', runtimeEnv),
ethics: readEnv('CONTACT_FORM_TO_EMAIL_ETHICS', runtimeEnv),
legal: readEnv('CONTACT_FORM_TO_EMAIL_LEGAL', runtimeEnv),
hr: readEnv('CONTACT_FORM_TO_EMAIL_HR', runtimeEnv),
careers: readEnv('CONTACT_FORM_TO_EMAIL_CAREERS', runtimeEnv),
};
return map[normalized] || defaultRecipient;
}
@ -111,7 +108,7 @@ export const POST: APIRoute = async ({ request, locals, url }) => {
const company = required(form.get('company'));
const email = required(form.get('email'));
const country = required(form.get('country'));
const department = required(form.get('department')) || 'general';
const department = required(form.get('department')) || 'info';
const message = required(form.get('message'));
if (!name || !email || !country || !message) {