Document template editor
What the Screen Is For
Edit and preview document content with its merge fields, or inspect built-in content and duplicate it for customization.
What It Shows and Lets People Do
The dedicated page opens existing content or a new draft of the selected kind. Saving creates or replaces customer content, and duplication opens an editable copy. The source editor and merge-field picker drive a debounced sample preview. The preview retains its last successful render while another request runs or fails.
States and Errors
The console entry gate accepts read, create or edit permission, while fetching an existing template still requires service read permission. Built-ins and forms without edit permission are read-only. New creation and existing replacement have separate write gates. Liquid problems and empty sample fields appear in the preview; recipient limits and source validation apply on save. A failed initial load stays on the page as an inline notice. Successful creation replaces the route with the existing template’s edit page.
Patterns It Must Respect
Full-width source editor with merge-field picker and document preview. Kind-specific email and statement-recipient controls. Read-only built-in and permission-restricted forms with duplicate-to-edit action. Unsaved-changes protection. Initial loading indicator and inline failure notice.