Skip to content

feat: add file backend for writing emails to disk#24

Open
nklsw wants to merge 2 commits into
litestar-org:mainfrom
nklsw:feat/file-backend
Open

feat: add file backend for writing emails to disk#24
nklsw wants to merge 2 commits into
litestar-org:mainfrom
nklsw:feat/file-backend

Conversation

@nklsw

@nklsw nklsw commented May 13, 2026

Copy link
Copy Markdown

Description

  • Add FileBackend that writes each outgoing email to its own file on
    disk - similar dev/inspection use case as ConsoleBackend, but persistent
  • Support two output formats: .eml (RFC 5322, opens in Apple Mail /
    Thunderbird / VS Code preview) and .txt (identical to
    ConsoleBackend output)

Usage

# Default .eml format - opens in any mail client
  config = EmailConfig(
      backend=FileConfig(path="./tmp/emails"),
      from_email="noreply@example.com",
  )

  # Plain-text dump (matches ConsoleBackend output)
  config = EmailConfig(
      backend=FileConfig(path="./tmp/emails", format="text"),
      from_email="noreply@example.com",
  )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant