Mailglass (Mailglass v1.0.0)

Copy Markdown View Source

Transactional email framework for Phoenix.

Composes on top of Swoosh, shipping the framework layer Swoosh omits: HEEx-native components, LiveView preview dashboard, normalized webhook events, suppression lists, RFC 8058 List-Unsubscribe, multi-tenant routing, and an append-only event ledger.

Getting Started

config :mailglass,
  repo: MyApp.Repo,
  adapter:
    {Mailglass.Adapters.Swoosh,
     swoosh_adapter:
       {Swoosh.Adapters.Postmark, api_key: System.fetch_env!("POSTMARK_API_KEY")}}

Stability Contract

The canonical v1.x contract inventory for the core package lives in docs/api_stability.md.

Treat this module as a narrow root entrypoint:

  • Mailglass.deliver/2, deliver!/2, deliver_later/2, deliver_many/2, and deliver_many!/2 are stable adopter-facing delegates.
  • Root reachability or Boundary exports do not mean every exported Mailglass.* module is promised public API.
  • Exported helpers used for framework wiring, internal implementation, or sibling-package integration remain classified in the stability inventory as stable, internal, or sibling-package-only.

Architecture

See Mailglass.Config, Mailglass.Renderer, Mailglass.Components, and docs/api_stability.md.

Summary

Functions

deliver(msg, opts \\ [])

(since 0.1.0)

Synchronous delivery. See Mailglass.Outbound.deliver/2.

deliver!(msg, opts \\ [])

(since 0.1.0)

Bang variant. See Mailglass.Outbound.deliver!/2.

deliver_later(msg, opts \\ [])

(since 0.1.0)

Asynchronous delivery. See Mailglass.Outbound.deliver_later/2.

deliver_many(msgs, opts \\ [])

(since 0.1.0)

Batch async delivery. See Mailglass.Outbound.deliver_many/2.

deliver_many!(msgs, opts \\ [])

(since 0.1.0)

Bang batch variant. See Mailglass.Outbound.deliver_many!/2.