New admin panel "E-Mail" tab (Einstellungen -> E-Mail) lets the shop
owner configure their SMTP server, test the connection with a real
test email, set which address receives new-inquiry notifications, and
edit both the customer confirmation email and the shop notification
email as templates with {{placeholder}} variables.
Previously SMTP config only lived in a non-DB config.php file (with a
blank host, so mail sending was effectively off) and there was no
customer confirmation email at all - only a hardcoded owner
notification. ContactController now sends both emails using the
DB-configured (or config.php-fallback) settings; mail sending stays
best-effort so a contact form submission never fails because of it.
Backend: new Mailer support class (config resolution, PHPMailer setup,
placeholder rendering) and MailSettingsController (show/update/test),
following the existing WebsiteSettings/DatabaseSettings conventions
(password never returned in plaintext, empty password on save keeps
the existing one). New app_settings columns wired into Schema.php so
the "Datenbankstruktur aktualisieren" admin button picks them up on
existing installs.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
18 lines
1 KiB
SQL
18 lines
1 KiB
SQL
-- SMTP-Einstellungen und E-Mail-Vorlagen (Kundenbestaetigung + Shop-Benachrichtigung)
|
|
-- admin-konfigurierbar machen. Additiv, nichts wird geloescht.
|
|
-- Hinweis: Auf der Live-Seite reicht stattdessen ein Klick auf "Datenbankstruktur aktualisieren"
|
|
-- unter Admin-Panel -> Einstellungen -> Datenbank.
|
|
|
|
ALTER TABLE app_settings
|
|
ADD COLUMN IF NOT EXISTS mail_host VARCHAR(255) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_port INT NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_username VARCHAR(255) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_password VARCHAR(255) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_encryption VARCHAR(10) NOT NULL DEFAULT 'tls',
|
|
ADD COLUMN IF NOT EXISTS mail_from_email VARCHAR(150) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_from_name VARCHAR(150) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_notify_email VARCHAR(150) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_customer_subject VARCHAR(255) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_customer_body TEXT NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_owner_subject VARCHAR(255) NULL,
|
|
ADD COLUMN IF NOT EXISTS mail_owner_body TEXT NULL;
|