Documents
Design, version and render PDF documents on Root Dashboard
Documents let your team design PDF documents, such as policy schedules, welcome letters and claim letters, directly on Root Dashboard. You don't need to change your product module code. Each document is versioned: you edit a draft, preview it against a real policy, and publish it when it is ready.
When a document is rendered, Root fills it with the data of the policy (or other entity) and keeps the PDF with that entity. Each render records the document version it used, so you can always see exactly what a policyholder received.
Documents are separate from the Handlebars policy documents built into a product module. Product module documents are released with the product module. Documents are published on their own, from the dashboard.
Documents belong to your organisationA document isn't tied to a product module: every product module and notification in your organisation can use it by its key. The product module key on a document is only for filtering the list. If a document is for one product, name its key after that product, for example
funeral_policy_schedulerather thanpolicy_schedule.
How documents are used
A published document is rendered in two ways:
- With a customer notification: a custom notification event's email template lists the documents to attach by key. Root renders them and sends the email with the PDFs attached. See Using documents.
- From product module code: a lifecycle hook returns a
render_org_documentaction. Once the PDF is ready, theafterDocumentGeneratedhook is called with a link to fetch it, for example to send it to a third-party integration such as a postal service provider.
You can list a policy's renders and download their PDFs through the Documents API.
Core concepts
| Concept | Description |
|---|---|
| Document | A named PDF document, such as a policy schedule, shared by your sandbox and production environments and by all your product modules. |
| Key | The document's unique identifier, used to attach or render it, such as welcome_letter. Lowercase letters, numbers and _. |
| Entity type | What the document is about: a policy (the default), application, claim, payment, payment_method, invoice, alteration or application_alteration. |
| Chapter | One part of a document. A static PDF, or a template with merge fields. Chapters are rendered in order and joined into one PDF. |
| Draft | The version you edit. Saving a draft never changes what production sends. |
| Published version | The version used for new renders. Published versions never change; editing starts a new draft. |
| Merge field | A placeholder such as {policyholder.first_name}, filled with the entity's data at render time. |
| Render | One generated PDF, linked permanently to its entity and to the version it used. |
What's next
- Document concepts: versions and publishing, sandbox and production, entity types and permissions.
- Designing a document: chapters, merge fields, expressions, conditional paragraphs and tables.
- Using documents: attaching documents to notifications, rendering them from product modules and finding renders.
Updated about 2 hours ago