FormWork documentation

Reusable Templates

Create project-level content and layouts for workflow email and PDF steps.

Reusable templates keep message/document content separate from workflow logic. A workflow can map its current data into a content template and optionally wrap it in a layout.

Choose the template type

TypePurposeRequirement
ContentThe email or PDF bodyNon-empty body
LayoutShared wrapper such as branding, header, footer, or termsMust contain {{ content }}

Both are scoped to one project and can be used by that project’s Send Email and Generate PDF steps.

Create a template

  1. Open a project and select Templates.
  2. Select New Template.
  3. Enter a Title and optional Description.
  4. Leave Use as layout template off for content; turn it on for a layout.
  5. Write the Body Template.
  6. Save.

The list shows name, Content/Layout type, detected merge-field count, last update, Edit, and Delete.

Add dynamic data

Templates support two complementary mechanisms:

  • FormWork references, such as {{entry:current.answers.customer_name}}, are resolved from the current workflow context.
  • Merge fields, such as {{ template.customer.name }}, declare named inputs that a workflow step maps explicitly.

Use references for data naturally tied to the current entry. Use merge fields when a template should expose a clean reusable input contract or receive a fixed/reference value chosen by each workflow.

<h1>Hello {{ template.customer.name }}</h1>
<p>Reference: {{entry:current.id}}</p>

The editor extracts template.* paths into a Tags schema. After selecting this template in a workflow, Template Data shows those paths as mapping targets.

Content and layout composition

A layout must place {{ content }} exactly where the rendered content body should be injected:

<main style="font-family: sans-serif">
  <header>Example Ltd</header>
  {{ content }}
  <footer>Thank you</footer>
</main>

Whitespace inside the token is accepted. Use Insert placeholder if the required token is missing.

In a Send Email or Generate PDF step:

  1. Set Content mode to reusable Template and select a content template, or keep content Inline.
  2. Choose FormWork’s default layout, no layout, or a reusable layout template.
  3. Map all detected merge fields in Template Data.
  4. Test the workflow with realistic data.

Understand the editor

  • Guide — examples for variables, loops, conditions, and layouts.
  • Tags schema — detected merge paths and their hierarchy.
  • Usage — every workflow step using this template, linked directly to that step.

The reference picker is unavailable until the project contains at least one form version, because it needs a schema context.

Saving a used template

If no workflow uses a template, Save updates it immediately. If it is in use—or usage cannot be confirmed—the editor offers:

  • Save for immediate effect — all referencing workflow steps use the new content without republishing those workflows.
  • Save as copy — creates a new template named (Copy), then (Copy 2), and so on.

Unsaved-change navigation offers Stay, Discard, Save as copy, or Save.

Reusable template edits are live dependencies. Use Save as copy when a change needs staged workflow adoption.

Delete carefully

The list allows deletion after confirmation. Check the Usage tab first and remove or replace references in workflows so they do not point to a missing template.

For variables, conditions, loops, and formatters, continue to Template Syntax.