Message Template Variables and Filters
Use message template variables to personalize email, SMS, Notify, and AI prompt content with contact, flow, enrollment, organization, sender, and unsubscribe values.
DripDrop uses Django-style template syntax, but this page documents the supported DripDrop subset. Other Django template features may not be supported, even if they look similar.
Supported Syntax at a Glance
Use double braces for variables:
Hi {{ contact.first_name }},
Use filters to format or transform values:
Hi {{ contact.first_name|default:"there" }},
Use if and else for conditional content:
{% if contact.first_name %}
Hi {{ contact.first_name }},
{% else %}
Hi there,
{% endif %}
Available Variables
Contact Variables
Use contact variables to personalize content with the enrolled contact’s details.
{{ contact.first_name }}
{{ contact.last_name }}
{{ contact.name }}
{{ contact.email }}
{{ contact.phone }}
Available contact variables:
contact.uuidcontact.first_namecontact.last_namecontact.namecontact.emailcontact.phonecontact.phone.as_e164contact.phone.as_nationalcontact.phone.as_internationalcontact.phone.as_rfc3966contact.custom.<field_key>
Example:
Hi {{ contact.first_name|default:"there" }},
Custom Field Variables
Use custom field keys under contact.custom, flow.custom, or enrollment.custom.
{{ contact.custom.company_name }}
{{ flow.custom.campaign_goal }}
{{ enrollment.custom.signup_source }}
Missing custom fields render blank.
Flow Variables
Available flow variables:
flow.uuidflow.nameflow.custom.<field_key>
Example:
You are receiving this from {{ flow.name }}.
Enrollment Variables
Available enrollment variables:
enrollment.uuidenrollment.custom.<field_key>
Example:
Your selected plan is {{ enrollment.custom.plan_name|default:"not selected yet" }}.
Organization Variables
Available organization variables:
organization.name
Example:
Thanks for your interest in {{ organization.name }}.
Sender Variables
Available sender variables:
sender.first_namesender.last_namesender.emailsender.phonesender.phone.as_e164sender.phone.as_nationalsender.phone.as_internationalsender.phone.as_rfc3966
Example:
Reply to {{ sender.first_name }} at {{ sender.email }}.
Compliance Variables
Use unsubscribe_url when you need to include an unsubscribe link.
{{ unsubscribe_url }}
For HTML content:
<a href="{{ unsubscribe_url|escape }}">Unsubscribe</a>
Conditional Content with IF and ELSE
DripDrop documents these conditional tags:
{% if ... %}{% else %}{% endif %}
Example:
{% if contact.custom.company_name %}
Thanks for checking out options for {{ contact.custom.company_name }}.
{% else %}
Thanks for checking out DripDrop.
{% endif %}
You can also check simple values:
{% if contact.email %}
We will send details to {{ contact.email }}.
{% else %}
Reply with your best email and we will send details there.
{% endif %}
Default and Fallback Values
default
Use default when blank values should fall back to replacement text.
Hi {{ contact.first_name|default:"there" }},
default_if_none
Use default_if_none when only None should fall back.
Plan: {{ enrollment.custom.plan_name|default_if_none:"Not selected" }}
Dates and Numbers
date
Use date to format date or datetime custom fields.
Signup date: {{ contact.custom.signup_date|date:"F j, Y" }}
Last seen: {{ contact.custom.last_seen|date:"Y-m-d g:i A" }}
floatformat
Use floatformat to control decimal places.
Estimated value: ${{ contact.custom.deal_value|floatformat:2 }}
Text Formatting
upper
{{ contact.first_name|upper }}
lower
{{ contact.email|lower }}
capfirst
{{ contact.first_name|capfirst }}
truncatechars
{{ contact.custom.notes|truncatechars:80 }}
truncatewords
{{ contact.custom.notes|truncatewords:12 }}
length
{% if contact.custom.notes|length %}
We have notes on file for you.
{% else %}
No notes yet.
{% endif %}
Boolean Formatting with yesno
Use yesno to display readable text for true, false, and unknown values.
SMS consent: {{ contact.custom.sms_opted_in|yesno:"Yes,No,Unknown" }}
Escaping and URL Encoding
escape
Use escape when inserting user-provided values into HTML content.
{{ contact.custom.company_name|escape }}
urlencode
Use urlencode when putting a value into a URL query string.
https://example.com/welcome?email={{ contact.email|urlencode }}
Unsupported or Undocumented Django Features
DripDrop documents a small supported subset of Django-style template syntax. Do not assume every Django template tag or filter is supported.
The following are not part of the documented DripDrop template surface unless DripDrop explicitly adds support later:
{% for %}loops{% include %}{% extends %}{% load %}{% url %}{% cycle %}- Custom template tags or filters
If you need more complex logic, consider using custom fields, flow conditions, or separate message templates.