Skip to content

Emails 0.7.0: Templates leave the database, and the module moves to PhoenixKit 3

Emails 0.7.0 moves the PhoenixKit email module to PhoenixKit 3. Email templates are now files, so the module drops its database templates and the admin pages that edited them. Export any template you edited before you update.

Templates are files now

With PhoenixKit 3, email templates come from files: the defaults that core and each module ship, and overrides a host app keeps through phoenix_kit_templates. The database templates this module used to serve are retired.

What goes away in the admin:

  • the Templates list and the template editor, with their New Template and Edit Template tabs;
  • the Templates button on the emails list;
  • the link from an email’s details page to the template that built it.

The test email now always sends its built-in body.

The template table is no longer created on a fresh install. A site upgraded from PhoenixKit 2.x keeps its table and its rows untouched; nothing in this release drops it. The parts needed to carry old rows out stay: the Template schema, the template export and mix phoenix_kit_emails.templates.export, and Templates.send_email/4, which billing’s emails still go through.

Repair and doctor know the module’s tables

The module now gives PhoenixKit a description of its 11 tables, generated from its own migrations. mix phoenix_kit.repair and mix phoenix_kit.doctor use it to check them. Repair only adds what is missing and reports the rest, and it checks only while the database is at the module’s current migration version.

Upgrading

Before you update, if anyone edited an email template in the admin, run mix phoenix_kit_emails.templates.export and commit the files it writes. PhoenixKit 3 no longer reads the table, so edits left there stop taking effect. The task now stops with a clear message when the table does not exist.

Emails 0.7 needs PhoenixKit 3.0 or later (below 4.0) and no longer runs on PhoenixKit 2.x. There is no migration in this release.

Full release notes: Emails 0.7.0

0.7.0 · 27 October 2026

Removed

  • The database template layer is retired (core 3.0). Email templates are files now (phoenix_kit_templates overrides over the defaults core and modules ship). Gone: the Templates list and Template editor admin pages and their tabs, the template CRUD/clone/archive/render/usage/stats API and seed_system_templates/0 in Templates, the Provider callbacks get_active_template_by_name/1, render_template/2,3, track_usage/1 and get_source_module/1, the database layer in TemplateSources (and its shadow badges), the “Open template” link on the log details page, and the Templates button on the email list. The test email always sends the built-in body now. The log’s source_module filter reads message_tags only.
  • phoenix_kit_email_templates is no longer created. The chain does not adopt the table or any of its indexes and constraints (V1); V3’s html-body rewrite runs only where the table exists. A host upgraded from core 2.x keeps its table untouched; this package never drops it.

Upgrade note

Run mix phoenix_kit_emails.templates.export before upgrading to core 3.0 if you edited any template in the admin UI: core 3.0 no longer reads the table, so unexported edits stop taking effect. The task now stops with a clear message when the table does not exist.

Kept (legacy, read-only)

  • Templates.send_email/4 (billing’s emails go through it), Templates.default_system_templates/0 and list_templates/0, the Template schema, TemplateExport (including the new TemplateExport.active_template/1, which returns the active legacy row by name, or nil when the table is absent) and the export mix task: they exist only to carry old rows out into files.

Changed

  • Core pin is >= 3.0.0 and < 4.0.0. This module no longer serves email templates from the database, and core 2.x still calls the provider callbacks that were removed, so it needs core 3.0 (open through core 3.x).

Added

  • The module supplies the manifest of its 11 tables (expected_schema/0, PhoenixKit.Modules.Emails.ExpectedSchema), so mix phoenix_kit.repair and mix phoenix_kit.doctor check and repair them again, now from the module’s own chain instead of core’s manifest. Generated from PhoenixKit.Modules.Emails.Migrations by core’s dev_docs/squash/generate_module_manifest.exs, never edited by hand. Core uses it from the first release after 2.64.1; before that nothing reads it. Repair is additive (it creates what is missing and reports the rest) and checks the tables only while the database is at the chain’s current version. No migration.
  • A builds-alone test: the chain builds every email table the way core’s chain does, without core’s. It runs once the package resolves the next core release.

Emails 0.7.0. Install or update: {:phoenix_kit_emails, "~> 0.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.