feat: SMTP email notification channel with UI and ingest

Migration 006, email config DB/env, smtplib sender, settings API,
Settings UI section, and dispatch on event/problem ingest.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 16:12:55 +10:00
parent 20fa7e2c27
commit 9b177c145b
13 changed files with 945 additions and 195 deletions
@@ -17,6 +17,14 @@ class NotificationChannel(Base):
webhook_url: Mapped[str | None] = mapped_column(Text, nullable=True)
webhook_secret_header: Mapped[str | None] = mapped_column(String(64), nullable=True)
webhook_secret: Mapped[str | None] = mapped_column(Text, nullable=True)
smtp_host: Mapped[str | None] = mapped_column(Text, nullable=True)
smtp_port: Mapped[int | None] = mapped_column(nullable=True)
smtp_user: Mapped[str | None] = mapped_column(String(128), nullable=True)
smtp_password: Mapped[str | None] = mapped_column(Text, nullable=True)
mail_from: Mapped[str | None] = mapped_column(String(256), nullable=True)
mail_to: Mapped[str | None] = mapped_column(Text, nullable=True)
smtp_starttls: Mapped[bool] = mapped_column(default=True)
smtp_ssl: Mapped[bool] = mapped_column(default=False)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
)