Notify question authors via Resend when an admin posts the first answer.

Require email at registration (editable on profile), add a Resend mailer with idempotent first-answer sends, and keep answer saves independent of delivery.
This commit is contained in:
2026-08-22 12:39:43 -07:00
parent 35c8c9f391
commit f61b4fc7ab
23 changed files with 589 additions and 71 deletions
+5
View File
@@ -4,11 +4,16 @@ CREATE TABLE IF NOT EXISTS users (
name TEXT NOT NULL,
password_hash TEXT NOT NULL,
role TEXT NOT NULL DEFAULT 'user' CHECK (role IN ('user', 'admin')),
email TEXT NOT NULL DEFAULT '',
avatar_url TEXT NOT NULL DEFAULT '',
state TEXT NOT NULL DEFAULT '',
created_at TEXT NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS users_email_lower_uidx
ON users (lower(email))
WHERE email <> '';
CREATE TABLE IF NOT EXISTS questions (
id TEXT PRIMARY KEY,
author_id TEXT NOT NULL REFERENCES users(id),