Templates
Manage type-less email templates and per-warehouse communication templates from one list and one editor.
Overview
Templates is the single admin home for both template models. The models stay separate:
| Kind | Model | Scope |
|---|---|---|
EmailTemplate |
Global, type-less catalogue (test_email, embedding_budget_exceeded, custom.*) |
|
| Communication | CommunicationTemplate |
Per-warehouse, notification-type, and channel (email, SMS) workhorse |
Do not look for a merged table or shared primary key. Plugin communication templates are still seeded by (warehouse_id, slug) with source='plugin:{package}'. Plugin email chrome still flows through ManifestNotificationTemplate, not EmailTemplate.
Sign-in, invitation, password reset, new-sign-in, and digest copy live on communication templates. TransactionalEmailResolver uses the active warehouse template when one exists. Otherwise it uses the shipped system copy, which also covers a tenant with no warehouse yet and a database that can't be reached. If even that fails, it sends a branded plain message. Deactivating a warehouse row never stops these emails; they go out with the shipped copy, wrapped in the default layout.
Where it lives
Routes:
- List:
/admin/settings/email-templates(alias/admin/settings/templatesredirects here) - Email edit:
/admin/settings/email-templates/{template}/edit - Communication edit:
/admin/settings/communication-templates/{template}/edit
Open Admin → Preferences → Templates.
Permissions: the index accepts either email-templates.manage or notifications.manage. Each row still requires the permission that kind already used — email actions stay on email-templates.manage, communication actions stay on notifications.manage.
Index
The list is a union of both kinds with filters for kind, channel, system/custom, and active/inactive.
| Action | Communication | |
|---|---|---|
| Create | Custom custom.* key |
Warehouse + channel + optional notification type |
| Edit | Opens the unified editor | Opens the same editor |
| Delete | Custom rows only | Custom rows only (system rows stay) |
| Duplicate | — | Any row (system rows become an editable copy) |
| Send test | Email channel | Email channel only |
Editor
Both edit URLs render one component, built on the communication editor (the superset).
Shared:
- Live preview (sample data; communication rows can also preview a real rental)
- Searchable click-to-insert merge-field browser
- Version history and restore (adapter over the two version tables —
version_numbervsversion; compiled-segment cache stays keyed off the communication version) - Email layout picker on email-channel rows
- Send test on email-channel rows
Kind-specific:
| Communication | ||
|---|---|---|
| Type / warehouse chrome | Hidden | Shown read-only |
| System row | Editable; Reset to Default restores the seeder | Read-only; Duplicate to customise |
| SMS segment counter | — | SMS channel |
Merge fields use {{ field.path }} with optional filters (| upper, | default:"N/A"). Email rows expose available_merge_fields; communication rows expose the notification type data_schema.
Email layout
The editor carries an Email Layout picker listing every active layout. The first option — Default — {layout name} — leaves email_layout_id null, so the template follows whichever layout is currently the default. Pick a specific layout to pin this one template to different chrome.
The live preview renders through the selected layout. If the chosen layout is later deactivated or deleted, send-time resolution falls back to the default layout and then to the shipped master layout — mail never fails because of a layout change.
See Email Layouts for the layout dialect and editor.
At a glance
Manage type-less email templates and per-warehouse communication templates from one list. System email templates can be reset to defaults; system communication templates are duplicated to customise.
| Action | Description |
|---|---|
| Edit | Modify the template title and HTML body |
| Reset | Revert a system template to its seeded default content |
Templates support merge fields using {{ field.path }} syntax with optional filters: {{ name | upper }}, {{ value | default:"N/A" }}. A merge field reference sidebar shows available fields for each template. Every edit creates a version snapshot for history tracking.
Sign-in, invitation, password reset, new-sign-in, and digest emails are edited as per-warehouse communication templates, not on this list.
Note
Requires email-templates.manage or notifications.manage.