Configuration · Email template preview & test send
Browse the centre’s transactional email templates, preview the rendered HTML and send a test copy to an address to check how it looks in a real inbox.
| Area | Configuration |
| Routes | configuration.email-templates · configuration.email-templates.index |
| Centre modules | always available |
| Staff levels | authenticated staff with configuration access |
| Models | email-template |
| UI label | title.header.configuration.email-templates / menu.navbar.email-template.show |
| Coverage | 3 use cases · 1 happy · 4 failure |
How it works
Read-and-test only — templates are not editable here. The route’s sendTestEmail guards its input (throw new TypeError('\email` is not a string’)) and converts a non-OK response into a thrown error, while send-email-template-modal validates the recipient list client-side (isValidEmail/validateEmails`) before calling it. Templates are sorted by label for a usable dropdown.
Use cases
Why someone opens this (3)
- Checking the registration or password-reset email after a branding change.
- Sending a test to a colleague for sign-off.
- Diagnosing a template that renders badly in a particular mail client.
Path map
flowchart LR F(["Email template preview and test send"]):::feat F --> H1["Template previewed and tested"]:::ok F -.-> X1["Invalid recipient address"]:::bad F -.-> X2["Non-string recipient"]:::bad F -.-> X3["Send fails"]:::bad F -.-> X4["No templates"]:::bad classDef feat fill:#566066,stroke:#566066,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Template previewed and tested
- User opens Configuration → Email templates and picks one from the dropdown.
- The rendered HTML preview appears.
- The user enters a recipient in the send-test modal;
validateEmailspasses.- The test is posted to
/email_templates/:id/send_testand arrives in the inbox.
Failure paths
Invalid recipient address
Cause — A malformed address in the list.
What happens —
validateEmailsreturns false and the send is not attempted; the modal shows the error.error.email.invalidcovers the generic case.
Non-string recipient
Cause —
sendTestEmailreceives a non-string first element.What happens — Throws
TypeError('\email` is not a string’)`.
Send fails
Cause — API returns non-OK.
What happens —
throw new Error(response)propagates to the modal’s.catch((errors) => …).
No templates
Cause — Centre has none configured.
What happens —
email-template.not_foundis shown as the dropdown’s empty message.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Template previewed and tested
- ⛔ Invalid recipient address
- ⛔ Non-string recipient
- ⛔ Send fails
- ⛔ No templates
Implementation
app/routes/configuration/email-templates/index.jsapp/models/email-template.jsapp/components/show-email-template.jsapp/components/email-template-preview.jsapp/components/send-email-template-modal.js
Translation keys (6)
Key English title.header.configuration.email-templatesEmail templates menu.navbar.email-template.showEmail templates email-template.select_oneSelect one template email-template.not_foundTemplates not found email-template.send.testSend test email error.email.invalidInvalid email address
Related
- Same area — Centre list & export · Centre editor (modules, app config, integrations) · Staff member list, deletion & restore · Staff member editor (levels, scope, API token) · Channels · Extra attributes · Dashboard configuration · Influence zones · Server incidents · Server command runner (CLI) · Accessibility statement · Mobile app configuration · Customer login methods (Google, Facebook) · Third-party integrations & connectors · Social wifi & location services
Generated from doc/feature-inventory.json · id config-email-templates · commit 276788ca6