diff --git a/.env.example b/.env.example index 2a04709..346e01b 100644 --- a/.env.example +++ b/.env.example @@ -46,4 +46,21 @@ AUTO_TIME_TYPE=Default AUTO_TIME_TITLE=Consuntivazione Automatica fine giornata AUTO_TIME_SUBJECT=Consuntivazione automatica ore mancanti AUTO_TIME_BODY=Consuntivazione eseguita automaticamente per il completamento delle ore lavorative giornaliere. -AUTO_TIME_CUSTOMER_USER=client_generic \ No newline at end of file +AUTO_TIME_CUSTOMER_USER=client_generic + +# --- Microsoft Graph API per invio email (metodo primario - Exchange con 2FA) --- +AZURE_TENANT_ID=your_tenant_id_here +AZURE_CLIENT_ID=your_client_id_here +AZURE_CLIENT_SECRET=your_client_secret_here +AZURE_MAIL_SENDER=helpdesk@example.com + +# --- SMTP Classico (fallback se Graph API non disponibile - lasciare vuoto per disabilitare) --- +SMTP_HOST= +SMTP_PORT=587 +SMTP_SECURE=false +SMTP_USER= +SMTP_PASSWORD= +SMTP_FROM=helpdesk@example.com + +# --- BCC automatico OTRS per tracciamento ticket --- +OTRS_MAIL_BCC=helpdesk@example.com \ No newline at end of file diff --git a/activityDb.js b/activityDb.js index a5c7231..545e6c5 100644 --- a/activityDb.js +++ b/activityDb.js @@ -35,6 +35,18 @@ db.exec(` ) `); +db.exec(` + CREATE TABLE IF NOT EXISTS email_signatures ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + agent_id INTEGER NOT NULL, + name TEXT NOT NULL, + body_html TEXT NOT NULL DEFAULT '', + is_default INTEGER NOT NULL DEFAULT 0, + created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), + updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) + ) +`); + try { db.exec(`ALTER TABLE agent_settings ADD COLUMN tickets_per_page INTEGER NOT NULL DEFAULT 50`); } catch (e) { diff --git a/package-lock.json b/package-lock.json index 042401a..d9b35f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "dotenv": "^16.4.5", "express": "^4.21.0", "mysql2": "^3.22.5", + "nodemailer": "^9.0.3", "pg": "^8.13.0" } }, @@ -898,6 +899,15 @@ "node": ">=10" } }, + "node_modules/nodemailer": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-9.0.3.tgz", + "integrity": "sha512-n+YP+NKwR5zRWa60k3GiQ6Q3B4KXCoAw40dAKeCtYn020iNN74aWK2liXIC3ZEATeGql7we3tE3t8QwhY0eskw==", + "license": "MIT-0", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", diff --git a/package.json b/package.json index f479484..6470b64 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dotenv": "^16.4.5", "express": "^4.21.0", "mysql2": "^3.22.5", + "nodemailer": "^9.0.3", "pg": "^8.13.0" }, "keywords": [ diff --git a/public/index.html b/public/index.html index da190da..eaff90b 100644 --- a/public/index.html +++ b/public/index.html @@ -89,6 +89,15 @@ Storico Attività Turbo +