Avvia i18n reale home IT EN TH e corregge rendering locale #8
@ -7,10 +7,7 @@ CONTACT_FORM_MODE=dev
|
|||||||
CONTACT_FORM_RESEND_API_KEY=
|
CONTACT_FORM_RESEND_API_KEY=
|
||||||
CONTACT_FORM_FROM_EMAIL=no-reply@nexstudio.com
|
CONTACT_FORM_FROM_EMAIL=no-reply@nexstudio.com
|
||||||
CONTACT_FORM_TO_EMAIL=info@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_PRIVACY=
|
||||||
CONTACT_FORM_TO_EMAIL_SECURITY=
|
CONTACT_FORM_TO_EMAIL_CAREERS=
|
||||||
CONTACT_FORM_TO_EMAIL_ETHICS=
|
|
||||||
CONTACT_FORM_TO_EMAIL_LEGAL=
|
|
||||||
CONTACT_FORM_TO_EMAIL_HR=
|
|
||||||
CONTACT_TURNSTILE_SECRET_KEY=
|
CONTACT_TURNSTILE_SECRET_KEY=
|
||||||
|
|||||||
20
README.md
20
README.md
@ -66,12 +66,9 @@ Variabili server (Cloudflare/local):
|
|||||||
- `CONTACT_FORM_RESEND_API_KEY`
|
- `CONTACT_FORM_RESEND_API_KEY`
|
||||||
- `CONTACT_FORM_FROM_EMAIL` (consigliato: `no-reply@nexstudio.ai`)
|
- `CONTACT_FORM_FROM_EMAIL` (consigliato: `no-reply@nexstudio.ai`)
|
||||||
- `CONTACT_FORM_TO_EMAIL` (default destinatario, es. `info@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_PRIVACY`
|
||||||
- `CONTACT_FORM_TO_EMAIL_SECURITY`
|
- `CONTACT_FORM_TO_EMAIL_CAREERS`
|
||||||
- `CONTACT_FORM_TO_EMAIL_ETHICS`
|
|
||||||
- `CONTACT_FORM_TO_EMAIL_LEGAL`
|
|
||||||
- `CONTACT_FORM_TO_EMAIL_HR`
|
|
||||||
- `CONTACT_TURNSTILE_SECRET_KEY`
|
- `CONTACT_TURNSTILE_SECRET_KEY`
|
||||||
|
|
||||||
Comportamento:
|
Comportamento:
|
||||||
@ -79,6 +76,19 @@ Comportamento:
|
|||||||
- `dev`: accetta submit e scrive payload nei log (senza invio reale)
|
- `dev`: accetta submit e scrive payload nei log (senza invio reale)
|
||||||
- `live`: valida Turnstile e invia email via Resend
|
- `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
|
## Deploy Cloudflare
|
||||||
|
|
||||||
Impostazioni consigliate:
|
Impostazioni consigliate:
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export const cta = {
|
|||||||
nameLabel: 'Nome',
|
nameLabel: 'Nome',
|
||||||
companyLabel: 'Azienda (opzionale)',
|
companyLabel: 'Azienda (opzionale)',
|
||||||
countryLabel: 'Paese',
|
countryLabel: 'Paese',
|
||||||
departmentLabel: 'Reparto',
|
departmentLabel: 'Area',
|
||||||
emailLabel: 'Email',
|
emailLabel: 'Email',
|
||||||
messageLabel: 'Scrivi qui il tuo messaggio',
|
messageLabel: 'Scrivi qui il tuo messaggio',
|
||||||
submitLabel: 'Invia messaggio',
|
submitLabel: 'Invia messaggio',
|
||||||
@ -54,13 +54,9 @@ export const cta = {
|
|||||||
fieldEmail: 'email',
|
fieldEmail: 'email',
|
||||||
fieldMessage: 'message',
|
fieldMessage: 'message',
|
||||||
departmentOptions: [
|
departmentOptions: [
|
||||||
{ value: 'general', label: 'Generale' },
|
{ value: 'info', label: 'Informazioni generali e commerciali' },
|
||||||
{ value: 'support', label: 'Support' },
|
{ value: 'privacy', label: 'Privacy' },
|
||||||
{ value: 'privacy', label: 'Privacy / DPO' },
|
{ value: 'careers', label: 'Careers / Collaborazioni' },
|
||||||
{ value: 'security', label: 'Security / Incident Response' },
|
|
||||||
{ value: 'ethics', label: 'Segnalazioni confidenziali (Ethics)' },
|
|
||||||
{ value: 'legal', label: 'Legal' },
|
|
||||||
{ value: 'hr', label: 'HR' },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@ -82,12 +82,9 @@ async function sendWithResend(apiKey: string, fromEmail: string, toEmail: string
|
|||||||
function resolveDepartmentRecipient(runtimeEnv: RuntimeEnv, defaultRecipient: string, department: string): string {
|
function resolveDepartmentRecipient(runtimeEnv: RuntimeEnv, defaultRecipient: string, department: string): string {
|
||||||
const normalized = department.trim().toLowerCase();
|
const normalized = department.trim().toLowerCase();
|
||||||
const map: Record<string, string> = {
|
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),
|
privacy: readEnv('CONTACT_FORM_TO_EMAIL_PRIVACY', runtimeEnv),
|
||||||
security: readEnv('CONTACT_FORM_TO_EMAIL_SECURITY', runtimeEnv),
|
careers: readEnv('CONTACT_FORM_TO_EMAIL_CAREERS', 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),
|
|
||||||
};
|
};
|
||||||
return map[normalized] || defaultRecipient;
|
return map[normalized] || defaultRecipient;
|
||||||
}
|
}
|
||||||
@ -111,7 +108,7 @@ export const POST: APIRoute = async ({ request, locals, url }) => {
|
|||||||
const company = required(form.get('company'));
|
const company = required(form.get('company'));
|
||||||
const email = required(form.get('email'));
|
const email = required(form.get('email'));
|
||||||
const country = required(form.get('country'));
|
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'));
|
const message = required(form.get('message'));
|
||||||
|
|
||||||
if (!name || !email || !country || !message) {
|
if (!name || !email || !country || !message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user