PhoenixKitInbox.Schemas.Delivery (PhoenixKitInbox v0.2.0)

Copy Markdown View Source

One mailbox's copy of a message — the row the mailbox UI actually lists.

Every folder view is a query over this table (mailbox_uuid + folder, ordered by inserted_at), which is why the migration puts a compound index there. All per-recipient state lives here rather than on the message:

  • folder — which of the six fixed folders the copy sits in
  • role"from" for the sender's own copy, "to"/"cc"/"bcc" for recipients. Drives the recipient chips in the reading pane.
  • seen_at — nil means unseen (the bold rows and the "Unseen" filter)
  • starred — the star toggle in the list
  • status"deleted" is the hard-delete tombstone; ordinary deleting moves the row to the "trash" folder instead

Folders

Fixed set, matching the reference webmail: inbox, sent, drafts, spam, trash, archive. Deliberately a column and not a table for 0.1.0 — user-defined folders/labels would be a phoenix_kit_inbox_labels table plus a join, and that is a v2 migration, not a v1 guess.

Tables are created by PhoenixKitInbox.Migrations, never by this schema.

Summary

Functions

The six fixed folders, in sidebar order.

Valid recipient roles.

Valid values for the status column.

Types

t()

@type t() :: %PhoenixKitInbox.Schemas.Delivery{
  __meta__: term(),
  folder: term(),
  inserted_at: term(),
  mailbox_uuid: term(),
  message_uuid: term(),
  role: term(),
  seen_at: term(),
  starred: term(),
  status: term(),
  updated_at: term(),
  uuid: term()
}

Functions

folders()

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

The six fixed folders, in sidebar order.

roles()

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

Valid recipient roles.

statuses()

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

Valid values for the status column.