feat: system settings, dynamic logos, template numbering, permission consolidation
- System settings page with tabs: Security, System, Firma
- Configurable attendance rules (break thresholds, rounding) from DB
- Configurable document numbering with template patterns ({YYYY}/{PREFIX}/{NNN})
- Dynamic logo upload (light/dark variants) served from DB instead of static files
- Email settings (SMTP from/name, alert/leave emails) configurable in UI
- Currency and VAT rate lists configurable, used across all modules
- Permissions simplified: offers.settings + settings.roles + settings.security → settings.manage
- Leaflet bundled locally, removed unpkg.com from CSP
- Silent catch blocks fixed with proper logging
- console.log replaced with app.log.info in server.ts
- Schema renamed: company-settings.schema → settings.schema
- App info section: version, Node.js, uptime, memory, DB status, NAS status
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import nodemailer from "nodemailer";
|
||||
import { config } from "../config/env";
|
||||
import { getSystemSettings } from "./system-settings";
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
sendmail: true,
|
||||
@@ -12,14 +13,18 @@ export async function sendMail(
|
||||
subject: string,
|
||||
html: string,
|
||||
): Promise<boolean> {
|
||||
const settings = await getSystemSettings();
|
||||
const from =
|
||||
settings.smtp_from ||
|
||||
config.email.smtpFrom ||
|
||||
config.email.contactFrom ||
|
||||
"web@boha-automation.cz";
|
||||
"noreply@example.com";
|
||||
const fromName =
|
||||
settings.smtp_from_name || config.email.smtpFromName || "System";
|
||||
|
||||
try {
|
||||
await transporter.sendMail({
|
||||
from: { name: config.email.smtpFromName, address: from },
|
||||
from: { name: fromName, address: from },
|
||||
to,
|
||||
subject,
|
||||
html,
|
||||
|
||||
Reference in New Issue
Block a user