-- Migration 009: Email Templates CREATE TABLE IF NOT EXISTS email_templates ( id INTEGER PRIMARY KEY AUTOINCREMENT, trigger_key TEXT NOT NULL UNIQUE, label TEXT NOT NULL, subject TEXT NOT NULL, body_html TEXT NOT NULL, body_text TEXT, enabled INTEGER DEFAULT 1, updated_at TEXT DEFAULT (datetime('now')) ); INSERT OR IGNORE INTO email_templates (trigger_key, label, subject, body_html, body_text) VALUES ('account_created', 'Account Created (to user)', 'Your NovaCPX hosting account is ready', '
Your hosting account for {{domain}} has been created.
Login: {{username}}
Password: {{password}}
Log in at {{panel_url}}
', 'Welcome, {{name}}! Your hosting account for {{domain}} has been created. Login: {{username}} / {{password}} at {{panel_url}}'), ('account_created_admin', 'Account Created (to admin)', 'New account created: {{domain}}', 'Domain: {{domain}}
User: {{username}}
Package: {{package}}
Created by: {{created_by}}
Your hosting account for {{domain}} has been suspended.
Reason: {{reason}}
Contact {{support_email}} to resolve this.
', 'Your account for {{domain}} has been suspended. Reason: {{reason}}. Contact {{support_email}}.'), ('account_terminated', 'Account Terminated (to user)', 'Your hosting account has been terminated', 'Your hosting account for {{domain}} has been permanently terminated. All data has been deleted.
', 'Your account for {{domain}} has been permanently terminated.'), ('password_reset', 'Password Reset', 'NovaCPX password reset request', 'A password reset was requested for your account. Click below to reset your password:
This link expires in 1 hour. If you did not request this, ignore this email.
', 'Password reset requested. Visit {{reset_url}} to reset your password (expires in 1 hour).'), ('ssl_expiring', 'SSL Certificate Expiring', 'SSL certificate for {{domain}} expires in {{days}} days', 'The SSL certificate for {{domain}} will expire in {{days}} days on {{expiry_date}}.
Log in to renew: {{panel_url}}
', 'SSL certificate for {{domain}} expires in {{days}} days on {{expiry_date}}.'), ('disk_warning', 'Disk Usage Warning', 'Disk usage warning for {{domain}}: {{usage}}% used', 'Your hosting account for {{domain}} is at {{usage}}% disk capacity ({{used}} of {{quota}} used).
Please free up space or upgrade your package.
', 'Disk warning: {{domain}} is at {{usage}}% capacity ({{used}} of {{quota}}).'), ('smtp_test', 'SMTP Test', 'NovaCPX SMTP Test Email', 'This is a test email from NovaCPX. If you received this, your SMTP configuration is working correctly.
', 'NovaCPX SMTP test email. SMTP is configured correctly.');