PhoenixKitWeb.Live.Settings.EmailPreview (phoenix_kit v2.52.2)

Copy Markdown View Source

Admin preview of every email the system knows (/admin/settings/email-sending/preview).

Lists PhoenixKit.Email.Catalog.entries/0 — core's emails and those enabled modules declare — and renders the chosen one in a chosen language with sample variables, through the same resolution a real send uses (PhoenixKit.Email.Catalog.preview/3). For every part it says where the content came from — the database template, a host file (with its path), or the built-in default — and which file to create to override it.

The HTML is shown in an <iframe srcdoc> with an empty sandbox: a database template's HTML is operator-authored and may carry anything, and an empty sandbox runs no script and reaches nothing of the admin page.

?email=<name>&lang=<code> selects the email and language, so a preview can be linked to. Not locale: that is the admin routes' own path parameter, which would shadow it. Gated like the Emails Transactional page (settings).

Summary

Functions

handle_event(binary, arg2, socket)

Callback implementation for Phoenix.LiveView.handle_event/3.

handle_params(params, url, socket)

Callback implementation for Phoenix.LiveView.handle_params/3.

mount(params, session, socket)

Callback implementation for Phoenix.LiveView.mount/3.

render(assigns)

Callback implementation for Phoenix.LiveView.render/1.