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.

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 %}

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.uuid
  • contact.first_name
  • contact.last_name
  • contact.name
  • contact.email
  • contact.phone
  • contact.phone.as_e164
  • contact.phone.as_national
  • contact.phone.as_international
  • contact.phone.as_rfc3966
  • contact.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.uuid
  • flow.name
  • flow.custom.<field_key>

Example:

You are receiving this from {{ flow.name }}.

Enrollment Variables

Available enrollment variables:

  • enrollment.uuid
  • enrollment.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_name
  • sender.last_name
  • sender.email
  • sender.phone
  • sender.phone.as_e164
  • sender.phone.as_national
  • sender.phone.as_international
  • sender.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>

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

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" }}

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 }}

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 %}

Use yesno to display readable text for true, false, and unknown values.

SMS consent: {{ contact.custom.sms_opted_in|yesno:"Yes,No,Unknown" }}

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 }}

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.