PhoenixKit.Modules.Emails.Status (phoenix_kit_emails v0.2.1)

Copy Markdown View Source

One snapshot of what the email system is actually doing right now.

Exists because every failure mode in this package is silent by design: the interceptor swallows its own errors so a logging problem can never break a send. That is the right trade — but it means an operator looking at "Email system: enabled" has no way to tell it apart from "enabled and recording nothing". summary/0 answers the questions the settings page should not have to guess at:

  • is the system on;
  • is anything being logged, and if not, why;
  • which mailer the messages actually leave through;
  • is the queue on, and can it even run (the :emails Oban queue lives in the host application's config — a package cannot add it);
  • what has happened today.

Summary

Functions

Everything the settings page needs, in one read.

Types

t()

@type t() :: %{
  system_enabled: boolean(),
  logging: :active | :system_disabled | :sender_invalid,
  sender: %{email: String.t(), loggable?: boolean()},
  transport: %{
    kind: :integration | :static,
    name: String.t() | nil,
    adapter: String.t()
  },
  queue: map(),
  save_body: boolean(),
  sampling_rate: integer(),
  today: %{
    logged: integer(),
    sent: integer(),
    failed: integer(),
    queued: integer()
  }
}

Functions

summary()

@spec summary() :: t()

Everything the settings page needs, in one read.