Skip to content

Inbox 0.5.0: Link email to your app's records, embed compose and never send twice

Inbox 0.5.0 connects PhoenixKit’s team mailbox to the rest of your Phoenix app: messages can be linked to your own records (a customer, an order, a project), each record can show its mail, and the compose form can be embedded in your own pages.

Mail that belongs to a record

send_message/4 now takes links: [%{kind:, ref:}], so a message can be filed against any object of your app, and a reply inherits the links of its conversation. Your app can also supply a resolver that finds objects named in the subject line.

ObjectMail lists a record’s mail as one viewer is allowed to see it, and the embeddable MailExplorer component shows that list on your own page. It has a picker for linking an existing message to the record and updates live as mail arrives.

The Inbox MailExplorer component on an order page of the host app: the order's conversations on the left, an open letter linked to the order on the right The Inbox MailExplorer component on an order page of the host app: the order's conversations on the left, an open letter linked to the order on the right

MailExplorer on an order page: the letters linked to order NW-1042, a reply filed with its conversation.

Compose inside your own pages

The new ComposeForm LiveComponent brings the inbox’s compose form into any page: recipient chips with suggestions from your own data (the RecipientSource behaviour), choice of sender, uploads and a supervised send. A send made from a form you built yourself goes through ComposePipeline.run/4, which re-checks everything on the server.

The Inbox ComposeForm component on an order page, filled in by the host: sender, a recipient chip, subject and message The Inbox ComposeForm component on an order page, filled in by the host: sender, a recipient chip, subject and message

ComposeForm on the same page, with the recipient, subject and text the page filled in.

Safer sending

  • Idempotent sends: pass idempotency_key: and a repeated send returns the first message instead of sending again.
  • Outbound.preview/2 and Messages.resolve_recipient_routes/2 show what a send would do before it runs.
  • New options: reply_to_trusted:, an html_body: for external recipients, and a shared mailbox can put the sender’s own name in its From name.
  • A change to the recipients between the check and the send can no longer route a message to the wrong mailbox, and a wrapper that retried an interrupted send can no longer send it twice.

Upgrading

Run mix phoenix_kit.update and then mix ecto.migrate for the new V07 migration (two new tables and one column, off for existing mailboxes). Only if you ran the module from its main branch and applied a V07 before 3 November 2026: repair that database first, as described in the module’s AGENTS.md; no published release had that earlier V07. Embedding is described in the README’s “Embedding” section.

Full release notes: Inbox 0.5.0

0.5.0 · 11 November 2026

PRs #12–#15 and their Claude and Codex review fixes.

Upgrade notes

  • One new migration, V07. Run mix phoenix_kit.update, then mix ecto.migrate. It adds phoenix_kit_inbox_message_links, phoenix_kit_inbox_send_keys and the personalize_from_name column of phoenix_kit_inbox_identities (off for every existing row).
  • A database migrated from main with V07 before 2026-11-03 must be repaired first. No release ever shipped that earlier V07. The repair is in AGENTS.md, under “Database & Migrations”.

Added

  • Links from messages to objects of the host (#12): send_message/4 takes links: [%{kind:, ref:}]. A reply inherits the links of its conversation. Host resolvers (LinkResolver) can find objects named in the subject.
  • Idempotent sends (#12): idempotency_key: makes a repeated send return the first message and do nothing else.
  • More server-side send options (#12): reply_to_trusted: and html_body: (the HTML of the email to external recipients, never shown to readers). A bound shared identity can put the sender’s name in its From name (personalize_from_name).
  • Messages.resolve_recipient_routes/2 and Outbound.preview/2 tell a host what a send would do before it runs.
  • The mail of an object (#13): ObjectMail lists an object’s mail as one viewer may read it. The embeddable Web.Components.MailExplorer shows that list, has a picker for linking a message to the object, and updates live.
  • Embedded compose (#14, #15): ComposeDraft, ComposePipeline.run/4 (re-checks on the server a send made from a host’s own form) and the RecipientSource behaviour (suggestions for To/Cc/Bcc). The Web.Components.ComposeForm LiveComponent handles recipient chips, the sender, uploads and a supervised send task. See “Embedding” in the README.

Fixed

  • A change to the recipient circle between ComposePipeline’s route check and the send could send a checked internal recipient to the wrong route or mailbox. The check and the send now use the same lookup.
  • A host wrapper that caught an interrupted send_fun could call it again and send twice.
  • An open MailExplorer picker could link a message to an object the host had just changed to. The picker now closes when its target changes.
  • Review fixes for PRs #10–#15 (ComposeForm upload handling with several forms on one page, the route of accounts named by handle, recipient input with a NUL byte or invalid UTF-8, folder-name limits).

Changed

  • Ecto 3.14.3 in the lock file (CVE-2026-118391).

Inbox 0.5.0. Install or update: {:phoenix_kit_inbox, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.