notiflowsDocs
LearnBuilding Notiflows

Templates

Create dynamic notification content with Liquid templating

Templates define the content of your notifications. Notiflows uses Liquid templating to insert dynamic content into your notifications.

Variable Contexts

Three variable contexts are available in templates:

ContextDescriptionExample
recipient.*Recipient user attributes{{ recipient.first_name }}
actor.*User who triggered the notification{{ actor.email }}
data.*Custom payload from trigger{{ data.order_id }}

Basic Syntax

Insert variables with double curly braces:

Hi {{ recipient.first_name }},

{{ actor.first_name }} left a comment on your post.

Filters

Transform values with filters:

{{ recipient.first_name | capitalize }}
{{ data.price | money }}
{{ data.created_at | date: "%B %d, %Y" }}

Conditionals

Use conditional logic:

{% if data.discount %}
You saved {{ data.discount }}!
{% endif %}

{% if recipient.plan == "premium" %}
As a premium member, you get early access.
{% else %}
Upgrade to premium for early access.
{% endif %}

Loops

Iterate over arrays:

Your items:
{% for item in data.items %}
- {{ item.name }}: {{ item.price }}
{% endfor %}

Template Types by Channel

Email

Email templates support three content types:

  • Visual - Drag-and-drop editor for rich HTML emails
  • HTML - Raw HTML with full control
  • Plaintext - Simple text emails
Subject: Order #{{ data.order_id }} confirmed

Hi {{ recipient.first_name }},

Thanks for your order! Here's what you purchased:

{% for item in data.items %}
- {{ item.name }} ({{ item.quantity }}x)
{% endfor %}

Total: {{ data.total }}

SMS

SMS templates use plaintext:

Hi {{ recipient.first_name }}, your order #{{ data.order_id }} has shipped! Track it: {{ data.tracking_url }}

Mobile Push / Web Push

Push templates have title and body fields (plaintext):

Title: New message from {{ actor.first_name }}
Body: {{ data.message_preview }}

In-App

In-app templates use markdown with a body and optional action URL:

Body: **{{ actor.first_name }}** commented on your post: "{{ data.comment_preview }}"
Action URL: {{ data.post_url }}

Chat (Slack)

Chat templates support markdown or JSON for rich formatting:

Markdown:

*New order #{{ data.order_id }}*
Customer: {{ actor.first_name }} {{ actor.last_name }}
Total: {{ data.total }}

JSON (Slack Block Kit):

{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Order #{{ data.order_id }}*\nCustomer: {{ actor.first_name }}"
      }
    }
  ]
}

Webhook

Webhook templates use JSON:

{
  "event": "order_shipped",
  "user_id": "{{ recipient.external_id }}",
  "order_id": "{{ data.order_id }}",
  "tracking_url": "{{ data.tracking_url }}"
}

Batch Templates

When using a batch step, access batched items:

You have {{ batch.size }} new notifications:

{% for item in batch.items %}
- {{ item.data.message }}
{% endfor %}

On this page