feat(cabana): mail layouts and partials screens with reset, drift and custom layouts
- Layouts and partials controllers with catalog scoping, reset action and File version diff - Custom layout create/delete with in-use refusal; meta.deletable and customized/outdated row states - List schema golden fixtures updated for the two new row-state message keys Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -177,6 +177,15 @@ The rows exist before anyone edits a template: when the admin starts, it writes
|
||||
|
||||
Saving a template stores your subject, message and layout in its row and marks it customized, together with the hash of the file the change was based on. From then on your version is sent instead of the file, until the template is reset to the file version. A save is checked the way a send would render it (`postcard.Editor.Validate`): a message that does not parse, does not render with the sample values or fails the safety checks is refused with a line under the field, and nothing is stored.
|
||||
|
||||
- **Mail layouts** lists postcard's default layout first, then every other file layout and every custom layout by name; the source column is the plugin, or Custom for a layout that exists only in the database. The form has HTML, Plain text and CSS tabs. A file layout's name stays the file's. **New layout** creates a custom layout: its code (lowercase letters, digits and dashes, and not used by another layout) is what template overrides store, so it cannot be changed later. A custom layout can be deleted, unless customized templates still use it: the refusal names the layout and how many templates use it.
|
||||
- **Mail partials** lists every partial, postcard's built-in ones included. The form edits the HTML and plain-text sections and shows how to call the partial, for example `{{ partial "button" "body" .body "type" .type "url" .url }}`.
|
||||
|
||||
Layouts and partials need `system.manage_mail_layouts`.
|
||||
|
||||
On a customized template, file layout or partial, **Reset to file version** returns the row to its file: your subject, message and layout choice (or the wrappers, CSS or sections) are discarded, and the file version is sent again. Rows that come from files are never deleted, and a custom layout has no file version to reset to.
|
||||
|
||||
When a plugin update changes a file you customized, your version is still sent, but the list marks the row Customized and File changed, the status filter's File changed choice finds it, and the form shows a notice. The File version tab shows the lines your version changed against the current file (lines starting with + are only in your version, lines starting with − only in the file) and the file itself. Saving your version again marks the change as reviewed; resetting takes the new file.
|
||||
|
||||
## Drivers
|
||||
|
||||
`mail.driver` selects the driver:
|
||||
|
||||
Reference in New Issue
Block a user