Module emails: see and take over the emails PhoenixKit sends
Describes Templates Editor 0.2.0.
PhoenixKit and its modules send emails of their own: account confirmation, password reset, order and billing emails and others. The Module emails group of the Templates editor shows each of them with its built-in text, and lets you give one a file of your own, which you then edit like any other template.
Where to find it
Settings › Emails Transactional, tab Email templates (/admin/settings/email-sending), the Module emails group in the left column. It needs the same as the rest of the editor: the module switched on and the Settings and Templates editor permissions to see it; the Edit email templates permission, on a server where editing is allowed, to create files. See the guide on editing email templates.
The list
Under Module emails the editor explains: Sent by PhoenixKit and its modules in their built-in text, until an email has a file here. Each email shows its name and a badge: built-in text while it has no file, file once it has one.
A module with a layout of its own (billing, for example) is listed too, with its Header, Footer and Page layout. Each part says has its own file or where it comes from now, and, where allowed, has a Create file button that makes the part’s file from your shared one or PhoenixKit’s.
Viewing an email
Click an email without a file to see it read only:
- Its name and description.
- A tab per language.
- What is sent: where the subject, text, HTML and Markdown come from right now. the Emails module’s database template, if shown, wins over every file.
- Built-in text: the subject and body PhoenixKit sends in that language.
- Variables: the placeholders the email uses.
- Send to me: sends the email to your own address, at most once every 30 seconds.
Emails that let people into their account or warn them about a sign-in (account confirmation, password reset, email change, magic link, registration, organization invitation and the sign-in alerts) carry a warning: This email lets people into their account or warns them about a sign-in: a mistake in it can keep everyone out or hide an intrusion. Send it to yourself before relying on it.
Giving an email a file
Only emails the host developer allowed can get a file. For any other, the page says This email may not be overridden here: it is shown read only. No email is allowed until the developer lists them.
For an allowed email the page says: A file made here is this email’s text from then on: translations a module update brings no longer reach this email. Then:
- Create file from the built-in text writes the built-in text into files, one per language of the editor.
- Create file from the database template appears when the Emails module is installed and has an active database template with this name. It makes the files from that template instead.
After that the email shows the file badge and opens in the normal editor, with its fields, preview and Send to me.
Once an email has files, there is no button to overwrite them from the database template again. That has to be done outside the editor and merged by hand.
What it doesn’t do
- It doesn’t let you edit an email PhoenixKit sends until it has a file here, and only for the emails the host allows.
- It doesn’t keep a taken-over email in step with module updates: from then on the file is its text.
- Under the host’s “all emails” setting it still leaves out the sign-in emails listed above; those can only be allowed by name.
For developers
Which module emails may get a file is the overridable key of config :phoenix_kit_templates_editor: a list of email names, or :all, which covers every one but the account and sign-in emails. The default [] allows none.