/settings/templates.
Overview
The page is wrapped inRequirePermission for pf.templates.view. It uses a tab-based layout with the active tab synced to the ?tab= query parameter. The four tabs are:
- Letterheads — manage organization letterheads with logo and branding (
LetterheadListPage). - Documents — manage document templates with rich-text editing (
DocumentTemplateListPage). Linked sub-routes:/settings/templates/documents/new,/settings/templates/documents/:id. - Approvals — manage approval chain templates (
ApprovalChainTemplateListPage). Linked sub-routes:/settings/templates/approvals/new,/settings/templates/approvals/:id. - Starter — browse pre-built starter templates (
StarterTemplatesBrowser).
Who it’s for
Requirespf.templates.view (route guard via RequirePermission).
Before you start
- No prerequisites for viewing. Content appears immediately on load.
- Creating or editing templates may require additional permissions.
Steps
- Navigate to Settings → Templates (
/settings/templates). - Select the appropriate tab: Letterheads, Documents, Approvals, or Starter.
- Use the New button within each tab to create a template.
- Edit or delete existing templates using the actions on each card.
Key concepts
Letterhead — branded page header/footer layout used in PDF output, including logo, address, and color scheme. Document template — rich-text template with variable insertion points for generating populated PDFs. Approval chain template — a configured sequence of approvers for use in approval workflows.Creating or editing a letterhead
The Letterhead editor (/settings/templates/letterheads/new and /settings/templates/letterheads/:id) renders LetterheadEditor, which handles both new and edit modes.
Fields include name, description, organization name display, full mailing address, phone, email, and website. A LogoUpload component handles logo uploads with configurable position (left, center, right) and max-height. Header configuration controls visibility of logo, org name, address, and contact info, plus a custom bar color. Footer configuration controls page numbers, confidentiality notice text, and its display. A live LetterheadPreview shows the result. The editor uses useLetterheadMutation() for save operations.
- Navigate to Settings > Templates > Letterheads and select New, or click an existing letterhead to edit.
- Enter a Name and optional description.
- Fill in the organization details (name, address, phone, email, website).
- Upload a logo and set its position and maximum height.
- Configure header and footer display options.
- Review the live preview and save.
barColor field sets the accent bar color.
Footer config — Controls page number display and the confidentiality notice text shown at the bottom of each page.
Creating or editing a document template
The Document Template editor (/settings/templates/documents/new and /settings/templates/documents/:id) renders DocumentTemplateEditor, which handles both new and edit modes.
Templates have a name, description, type (policy, procedure, letter, report_cover, other), status (draft, active, deprecated), and an optional letterhead assignment from useOrgLetterheads(). The template body is composed of sections via SectionEditor. An AI-assisted SectionSuggester can propose additional sections. Version history is accessible via DocumentTemplateVersionDiff. A PDF preview can be generated via useGenerateTemplatedPdf().
- Navigate to Settings > Templates > Documents and select New, or click an existing template to edit.
- Enter a Name and optional Description.
- Select a Type and Status.
- Optionally assign a Letterhead.
- Add and order sections using the section editor. Use the AI suggester if enabled.
- Preview the PDF output if needed.
- Save the template.
draft templates are not available for document generation; active templates are available; deprecated templates are hidden from new use but preserved for existing documents.
Sections — Ordered content blocks that define the structure of generated documents. Each section has a name and editable body.
Creating or editing an approval template
The Approval Chain Template editor (/settings/templates/approvals/new and /settings/templates/approvals/:id) renders ApprovalChainTemplateEditor, which handles both new and edit modes.
The page uses react-hook-form with Zod validation (approvalChainSchema). The form collects name, description, category (policy, document, financial, hr, compliance, general), and a steps array. Each step has a step_order, name, approver_type (user, role, dynamic, field), approver_config, parallel_mode (any/all), timeout_hours, and reminder_hours. Steps are managed via ApprovalStepEditor. At least one step is required. A back button navigates to /settings/templates.
- Navigate to Settings > Templates > Approvals and select New, or click an existing template to edit.
- Enter a name (required, max 200 characters) and optional description (max 1000 characters).
- Select a Category from: policy, document, financial, hr, compliance, or general.
- Add at least one approval step using
ApprovalStepEditor. For each step, set the name, approver type, approver config, parallel mode, timeout hours, and reminder hours. - Click Save. Validation errors are shown inline.
Approver types
Approver types
user requires a specific user_id. role requires a role string. dynamic uses a resolver enum (manager or department_head). field uses a field string to resolve the approver at runtime.Parallel mode
Parallel mode
any means only one approver in the step needs to approve. all requires every approver to approve before the chain advances.Timeout and reminder
Timeout and reminder
timeout_hours sets when the step escalates or fails if no approval is given. reminder_hours sets how many hours before the timeout to send a reminder notification.Related
Platform Foundation
Platform Foundation overview.
Governance & parity
Documentation coverage and governance.
This page documents shipped product behavior. It is not medical, legal, or
billing advice. Verify against your organization’s policies and applicable
regulations before using it for clinical, compliance, or billing decisions.
Protected health information (PHI) shown in the product is governed by your
tenant’s access controls and is never exposed in this documentation.
Documentation sources
Documentation sources
- src/routes/platform.tsx
- src/platform/templates/pages/TemplatesSettingsPage.tsx
- src/platform/templates/pages/LetterheadListPage.tsx
- src/platform/templates/pages/LetterheadEditor.tsx
- src/platform/templates/pages/DocumentTemplateEditor.tsx
- src/platform/templates/pages/ApprovalChainTemplateEditor.tsx
- src/platform/templates/hooks/index.ts