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
+2
View File
@@ -29,6 +29,7 @@ func (p *Postgres) CreateUser(ctx context.Context, u *User) error {
return fmt.Errorf("invalid role")
}
u.Username = NormalizeUsername(u.Username)
u.Email = NormalizeEmail(u.Email)
if u.ID == "" {
u.ID = uuid.NewString()
}
@@ -69,6 +70,7 @@ func (p *Postgres) CreateUser(ctx context.Context, u *User) error {
Name: u.Name,
PasswordHash: u.PasswordHash,
Role: string(role),
Email: u.Email,
CreatedAt: u.CreatedAt,
}); err != nil {
return mapUniqueViolation(err)