Personalize Content
Learn how to personalize notification content in Novu using template variables, context data, and LiquidJS filters across all channel template editors.
Novu allows you to personalize notification content in all channel template editors using variables, conditional logic, and runtime data. This enables you to generate notifications that adapt to each subscriber and reflect the data available at the time a workflow is executed.
Template variables
Template variables are placeholders that are resolved at workflow execution time and replaced with actual values when a notification is rendered. They allow templates to reference data from the workflow trigger payload, subscriber profile, workflow metadata, and outputs from previous steps.
To insert a variable into a notification template, use double curly braces:
Variables also support nested objects and arrays. Use dot notation to access nested values:
Template variables can be used anywhere content is supported. They can be rendered directly, formatted using LiquidJS filters, or used within conditional logic and loops to control how content is displayed.
Payload variables
Payload variables represent the structured data available to a workflow through its payload schema. This payload data can originate from the event trigger or be defined and managed directly in the workflow’s payload schema.
Payload variables are accessed using the payload namespace:
For example, if your payload schema defines the following fields:
You can reference them in your notification templates as:
Payload variables provide a stable, predictable interface for dynamic data in your templates. By defining them in the payload schema, you ensure that all templates, step conditions, and action configurations reference a consistent set of fields.
Subscriber variables
Subscriber variables expose data associated with the recipient of a notification. They allow you to personalize message content based on who the notification is for, making each delivery feel contextual and relevant.
Subscriber variables are accessed using the subscriber namespace:
You can reference both standard subscriber fields and custom subscriber attributes stored on the subscriber profile.
Standard fields include commonly used properties such as subscriber.firstName, subscriber.lastName, and subscriber.email. Custom attributes are stored under the data object and can be accessed using subscriber.data.*.
Workflow variables
Workflow variables provide access to metadata defined on the workflow that is being executed such as the workflow:
- Severity level
- Tags
- Name
- Description
- Workflow identifier
This workflow data can be used in the templates editor to personalize message content. Workflow variables are accessed using the workflow namespace:
Digest variables
Digest variables expose the data produced by a Digest step and are available to all channel steps that run after that digest step. They allow you to summarize, list, or otherwise represent multiple events that were grouped during the digest window.
Digest variables are accessed under the steps namespace and are scoped to the specific digest step.
Digest support is split into two categories:
- Digest step variables: Raw values produced by the digest step
- Digest template helpers: Preformatted helpers built on top of those raw values
The step variables expose data, while template helpers optimize for common notification use cases.
Digest step variables
Digest step variables expose the underlying data collected during the digest window. These variables hold values only.
-
steps.digest-step.events: The
steps.digest-step.eventsvariable is an array that contains all the events collected by the digest step. Each item in the array represents a digested event, including the payload with which the workflow was triggered.You can loop through it to build dynamic message lists, such as comment summaries or blog post digests, or use LiquidJS filters.
-
steps.digest-step.eventCount: The
steps.digest-step.eventCountvariable holds the total number of events collected during the digest step window.It is an integer value and can be used directly in the template editor or passed into LiquidJS filters like pluralize to generate grammatically correct summaries.
Digest template helpers
Digest template helpers are preconfigured template variables designed to simplify common digest use cases. Internally, they are built by combining digest step variables with LiquidJS filters.
They exist to reduce template complexity and eliminate repetitive logic.
-
steps.digest-step.countSummary: The
countSummaryvariable returns a human-readable summary of the total number of digested events with correct pluralization applied.This helper is built using
steps.digest-step.eventCountand the LiquidJSpluralizefilter. When used, it inserts logic equivalent to:For example, if the digest collected five events, then the output would be:
You can use this helper when you want a concise count without manually managing plural rules.
-
steps.digest-step.sentenceSummary: The
sentenceSummaryvariable returns a sentence-style string listing key items from the digested events array, such as a list of names, and gracefully handles formatting depending on the number of items present.This helper is built using
steps.digest-step.eventsand the LiquidJStoSentencefilter. When thesentenceSummaryvariable is used in the template editor, it inserts logic equivalent to:If the events contain names "Radek", "Dima", and five more users, then the result would be:
You can configure the
toSentencefilter from the template editor by passing:- A key path to extract from each item, for example,
payload.name. This is a required argument. - The number of items to display before collapsing.
- The suffix to use for remaining items, for example, "others".
- A key path to extract from each item, for example,
Context variables
Context variables come from context data. Once a context is created either through the Novu dashboard or API, its data becomes available in all channel template editors and can be referenced using the context namespace.
Context variables are typically used for tenant details, branding and configuration that should not live in the workflow payload or data shared amongst different entities in Novu.
Apply logic with LiquidJS
All Novu template editors support LiquidJS. This allows you to add logic and control flow to your notification content, including conditional rendering, iteration, and value transformation directly inside channel template editors.
{% if %} or {% for %}.Conditional rendering
You can use the conditional statements in LiquidJS if-else statements to control whether content is shown based on a condition.
'value'). Double quotes ("value") are not supported.Iteration and loops
You can loop over arrays using {% for %} loop. This is useful when rendering lists of items, events, or grouped data.
Filters and transformations
You can use filters to transform values before rendering them. Filters are applied using the pipe (|) symbol and can be chained.
Configure variables
Novu provides a built-in variable configuration UI in the template editor that allows you to apply LiquidJS filters to variable output.

When you insert a variable into the template editor, click the variable to open the configuration menu.

From this menu, you can:
- Apply Liquid filters
- Reorder applied filters
The filter input also provides filter suggestions, making it easier to discover and apply available filters. You can apply one or more filters to control how the variable value is rendered in your notification content.
Filters are applied top to bottom, meaning the output of one filter becomes the input for the next. You can reorder filters using drag and drop to change the execution order.
Channels Template Editors
Learn how to design and configure notification content for email, in-app, push, and SMS.
Trigger Workflow
Learn how workflows are triggered in Novu using the Event API, including triggering workflows for individual subscribers, attaching context data, and broadcasting notifications to topics.