Message Template Variables and Filters
Use message template variables and filters to personalize email, text message, Notify, and AI content with contact, flow, enrollment, organization, sender, AI analysis, media, and unsubscribe values.
Drip Drop validates saved content with Django template syntax. Messages can use only the variables listed on this page. The editor preview does not support every variable and filter that Drip Drop evaluates when sending.
01 Insert a Variable
- Place the cursor in the Subject or Body field. In a drag-and-drop email, first place the cursor inside a text block.
- Select Insert variable (
{ }). - Choose the variable you want. Drip Drop inserts its exact token at the cursor.
For the complete create and edit workflow, see Message Templates.
02 Preview Variable Output
- Review the preview beside the editor. On a smaller screen, select Preview.
- For email, compare Plain Text and HTML output when both are available.
- Check the sample contact values, your organization and sender values, and typed custom-field samples before saving.
The editor preview is a client-side approximation. It substitutes advertised variables and applies date and floatformat, but it does not execute Django block tags or other filters. Saved messages are validated and rendered by Django when they are sent.
Available Variables
Variables in the Insert Variable Menu
The Insert variable menu is a convenient authoring subset, not the complete send-time context.
- Contact: first name, last name, full name, email, phone, and contact custom fields.
- Organization: name and business address fields.
- Sender: first name, last name, email, and phone.
- Flow and Enrollment: custom-field keys for those records.
- Media: published assets, up to the first 100. The section label indicates when the list is truncated.
- Unsubscribe: the
%%UNSUBSCRIBE_URL%%placeholder.
The complete context below also includes UUIDs, flow.name, phone-format properties, AI analysis outputs, and additional media slugs. Those values remain valid even when they are not shown as built-in picker choices.
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.nameorganization.address.formattedorganization.address.line1organization.address.line2organization.address.cityorganization.address.stateorganization.address.postal_codeorganization.address.country
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 }}.
AI Analysis Variables
Use a successful upstream Analyze block’s output key and field key:
{{ ai.<output_key>.<field_key> }}
The latest successful run for that Analyze block supplies the value. A missing key, failed-only run, or unset output renders blank. Account-level template preview cannot resolve a flow-specific Analyze result, so it shows this variable as blank.
Media Variables
Published media assets are available by slug:
{{ media.<slug> }}
An unknown slug renders blank. The Insert variable menu lists up to the first 100 published assets; that menu limit does not narrow the send-time media context.
Compliance Variables
Use Insert variable → Unsubscribe to add the preferred authoring placeholder:
%%UNSUBSCRIBE_URL%%
Drip Drop replaces the placeholder with a recipient-specific URL when the message is sent. The send-time context also resolves {{ unsubscribe_url }}, but the editor inserts %%UNSUBSCRIBE_URL%%.
<a href="%%UNSUBSCRIBE_URL%%">Unsubscribe</a>
Conditional Content With If and Else
Drip Drop 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 an empty or otherwise false value should fall back to replacement text.
Hi {{ contact.first_name|default:"there" }},
default_if_none
Use default_if_none only when an existing value is None. It does not replace a missing custom-field key, which renders as an empty string.
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 }}
Syntax Validation and Preview Limits
Drip Drop validates saved message content with Django’s template engine. Verified block syntax includes if, for, and with, and template comments are accepted. Unknown tags, unknown filters, invalid block syntax, and mismatched closing tags prevent the template from saving.
Template code can read only the whitelisted message context documented on this page. It cannot traverse from contact or flow values into account owners, provider credentials, or other model relationships.
The editor preview is not a full Django renderer. It substitutes supported paths and previews date and floatformat, but it does not evaluate block tags or other filters.
Troubleshooting
No templates are visible
- Clear search, type, status, or tag filters.
- Confirm you are in the correct workspace.
Template is missing from a flow block
- Confirm the template type matches the block type.
- Check whether the template status needs to be Active for the place you are selecting it.
- Refresh the flow editor if the template was created in another tab.
Variables are not replaced
- Check the variable spelling and braces.
- Confirm the contact or custom field has a value.
- Preview with sample contact data before sending.
AI assistant is not available
- Confirm an AI provider is connected if your workspace uses AI-assisted template writing.
- Open Integrations → AI, then confirm AI integrations are enabled.
Related Docs
- Message Templates — create, preview, and save reusable email and text-message content.
- Flow Blocks — use templates and variables in Email, Text Message, Notify, and AI blocks.
- Contacts — manage the contact values and custom fields used by contact variables.
- Unsubscribe and Public Pages — review recipient-facing unsubscribe links and preview behavior.