SquatchMail.Email (SquatchMail v0.1.0)

Copy Markdown View Source

A captured or sent email and its lifecycle status.

Each email carries a non-enumerable public_id used in dashboard URLs, an optional SES message_id (the correlation key for downstream events), and denormalized recipient/attachment metadata. Bodies are stored inline; large MIME payloads are out of scope for this schema.

Summary

Functions

Builds a changeset for an email. A public_id is generated automatically when one is not supplied.

Returns the list of valid email statuses.

Types

t()

@type t() :: %SquatchMail.Email{
  __meta__: term(),
  adapter: term(),
  attachments: term(),
  attachments_count: term(),
  error: term(),
  events: term(),
  from_email: term(),
  from_name: term(),
  has_attachments: term(),
  headers: term(),
  html_body: term(),
  id: term(),
  inserted_at: term(),
  mailer: term(),
  message_id: term(),
  provider_options: term(),
  public_id: term(),
  recipients: term(),
  sent_at: term(),
  status: term(),
  subject: term(),
  tags: term(),
  text_body: term(),
  updated_at: term()
}

Functions

changeset(email, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Builds a changeset for an email. A public_id is generated automatically when one is not supplied.

statuses()

@spec statuses() :: [String.t()]

Returns the list of valid email statuses.