Skip to content

Email notifications for events #228

@filthyrake

Description

@filthyrake

Summary

Add email notification support for key events.

Current State

No notification system. Users must check admin UI manually.

Proposed Features

Notification Events

  • Video upload completed (ready to view)
  • Transcoding failed (requires attention)
  • Worker went offline
  • Storage space low warning
  • Archive cleanup summary (weekly)

Email Configuration

  • SMTP server settings
  • Email templates (customizable)
  • Per-event enable/disable
  • Rate limiting (digest mode)

Configuration

VLOG_EMAIL_ENABLED = True
VLOG_SMTP_HOST = "smtp.example.com"
VLOG_SMTP_PORT = 587
VLOG_SMTP_USER = "vlog@example.com"
VLOG_SMTP_PASSWORD = "..."
VLOG_SMTP_USE_TLS = True
VLOG_EMAIL_FROM = "VLog <vlog@example.com>"
VLOG_EMAIL_ADMIN = "admin@example.com"
VLOG_EMAIL_DIGEST_MODE = True  # Combine multiple events into digest

Database Schema

CREATE TABLE email_preferences (
  id TEXT PRIMARY KEY,
  email TEXT NOT NULL,
  event_type TEXT NOT NULL,
  enabled BOOLEAN DEFAULT true
);

CREATE TABLE email_log (
  id TEXT PRIMARY KEY,
  recipient TEXT,
  subject TEXT,
  event_type TEXT,
  sent_at TIMESTAMP,
  status TEXT
);

Implementation Notes

  • Use aiosmtplib for async email sending
  • Background task for email delivery (don't block API)
  • Retry failed emails with exponential backoff
  • Consider using email service (SendGrid, SES) for reliability

Priority

Medium - important for operational awareness

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions