Emails: templates, branded HTML, audiences, opt-out, log; admin UI

This commit is contained in:
Claude committed 2026-10-01 01:49:02 +00:00
1 parent 2cc009d66f
commit cd985a1a7b
8 files changed
+723 -8

No files matched your search

+15
View File
@@ -759,6 +759,21 @@ const MIGRATIONS: &[&str] = &[
VALUES (NEW.user_uuid, 'achievement', NEW.achievement_id, strftime('%Y-%m-%dT%H:%M:%SZ', 'now'));
END;
"#,
// Emails sent from the panel: players can opt out of non-essential mail, and every send is logged.
r#"
ALTER TABLE users ADD COLUMN email_optout INTEGER NOT NULL DEFAULT 0;
CREATE TABLE email_log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
subject TEXT NOT NULL,
audience TEXT NOT NULL,
total INTEGER NOT NULL DEFAULT 0,
sent INTEGER NOT NULL DEFAULT 0,
failed INTEGER NOT NULL DEFAULT 0,
last_error TEXT,
started_at TEXT NOT NULL,
finished_at TEXT
);
"#,
];
pub async fn connect(data_dir: &Path) -> Result<SqlitePool> {