Skip to content

Email preview: see every email the site sends, and where its text comes from

Describes PhoenixKit 3.6.1. On an older release? The version menu above has this guide as it was then.

The email preview shows every email PhoenixKit and its enabled modules send, exactly as it would be built for a real send, in the language you choose. For each part of the email it also says where the text came from, and which file a developer creates to change it.

Where to find it

Settings → Emails Transactional, tab Branding, then Preview emails (/admin/settings/email-sending/preview). The welcome email’s own Preview button opens it on that email. You need the Settings permission, or the Owner or Admin role.

A preview can be linked to: ?email=<name>&lang=<code> picks the email and the language.

The email preview in PhoenixKit: a list of core and e-commerce emails on the left and the Welcome email shown with its subject and HTML on the right, with a language menu The email preview in PhoenixKit: a list of core and e-commerce emails on the left and the Welcome email shown with its subject and HTML on the right, with a language menu

Preview every email the site sends, in each language.

Choosing an email

The list on the left groups the emails by who sends them: Core for PhoenixKit’s own, and each enabled module under its name. Core’s emails are:

  • Account confirmation
  • Password reset
  • Email change confirmation
  • Magic link sign-in
  • Magic link registration
  • Organization manager invitation
  • Organization staff invitation
  • Organization invitation
  • New login alert
  • Failed sign-in alert
  • Passkey added
  • Passkey removed
  • Welcome
  • Notification

Language shows the email in another of the site’s languages.

What you see

  • Subject, or (no subject).
  • HTML: the email as a mail client shows it. If it has none: No HTML version: this email is sent as plain text only.
  • Text: the plain-text version, or No text version.

The email is filled with sample values. A placeholder that has no sample is listed at the top (Placeholders with no sample value (shown as written)), so you can see it is there. If the email cannot be built, the page says This email could not be rendered with the reason.

The accent colour and logo come from the Branding tab, so the preview shows a change there at once.

Where each part comes from

The table lists each part of the email: Subject, HTML body, Markdown body, Text body and the Layout group with its Layout, Header and Footer. Its Source column says one of:

  • Host file, with the file’s path: your site’s own file is used.
  • Built-in default: PhoenixKit’s text, translated into the chosen language.
  • Set by the sending code, Not used, or Empty file, ignored.

To override, create names the file that would replace that part. Files found but not used lists files that exist but do not count, for example an empty file.

The parts are replaced one by one: a site that only replaces the text body keeps PhoenixKit’s translated subject.

What it doesn’t do

  • It does not send anything. To send a real message, use Test Send on the Emails Transactional page.
  • Texts cannot be edited here. They are changed by adding files to the site’s code (below).
  • A file added on the server itself is lost on the next deploy: the files ship with the application’s code.

For developers

Override files live in the host app under priv/phoenix_kit_templates/ (or the paths in config :phoenix_kit, :template_paths). The template name is a folder, and each file is named for the part it supplies, optionally with a language code: for example priv/phoenix_kit_templates/new_login_alert/text.txt and text.de.txt. subject, text and layout are .txt, html is .html, markdown is .md. A file without a language code serves every language. Email files can use {{accent_color}} for the Branding colour.