Message Template Variables Guide
This guide explains all the variables you can use in your community's message templates. These variables will automatically be replaced with actual information when messages are sent.
Available Variables
Community Information
{{community_name}}
- Your Community's name{{community_brand_name}}
- Your Community's brand name
Advocate Information
{{advocate_first_name}}
- Advocate's first name{{advocate_profile_display_name}}
- Advocate's display name as shown on their profile{{advocate_profile_display_location}}
- Advocate's display location as shown on their profile{{advocate_profile_url}}
- Link to the Advocate's public profile page{{advocate_conversation_url}}
- Link to the Conversation (for Advocates){{advocate_conversations_url}}
- Link to all Conversations
Prospect Information
{{prospect_first_name}}
- Prospect's first name{{prospect_public_name}}
- Prospect's public display name (eg: first name + last initial){{prospect_conversation_url}}
- Link to the Conversation (for Prospects){{prospect_conversations_url}}
- Link to all Conversations
Conversations
{{message_content}}
- The actual message text{{is_current_relay_target}}
- Indicates if this Conversation is the current "Relay Target" for a given Advocate or Prospect.- For an Advocate, the "Relay Target" keeps track of the Conversation with the most recent messaging/notification activity.
- For a Prospect, the "Relay Target" could either be the Introduction that was set to them, or the Conversation with the most recent messaging/notification activity.
{{no_other_conversations}}
- True if this is the only active Conversation for an Advocate or Prospect{{one_other_conversation}}
- True if there is exactly one other Conversation for an Advocate or Prospect{{many_other_conversations}}
- True if there are multiple other Conversations for an Advocate or Prospect{{other_conversation_count}}
- The count of other active Conversations for an Advocate or Prospect{{other_conversation_advocate_names}}
- List of Advocate names from the other active Conversations for a Prospect{{other_conversation_prospect_names}}
- List of Prospect names from the other active Conversations for an Advocate
Prospect Introductions
{{introduction_message}}
- The Introduction message text{{introduction_phone_url}}
- Introduction URL that should be used for automatically logging in a Prospect and taking them to the Advocate's Profile to view their Introduction. This should be used only for Introduction notifications delivered via SMS Text Messages since it will also mark the Prospect's phone number as "Verified".{{introduction_email_url}}
- Introduction URL that should be used for automatically logging in a Prospect and taking them to the Advocate's Profile to view their Introduction. This should be used only for Introduction notifications delivered via Email since it will also mark the Prospect's email address as "Verified".
Phone Verifications
{{phone_verification_code}}
- The verification code sent to the Advocate or Prospects device for use in logging in.
How to Use Variables
Your message templates use Liquid templating, which means you can use variables and some basic logic in your messages. Variables are written using double curly braces like this: {{variable_name}}
. When a message is sent, these will be replaced with the actual information.
Basic Liquid Syntax
You can use these Liquid features in your templates:
- Variables:
{{variable_name}}
- If Statements:
{% if variable_name %} This will show if the variable is true {% else %} This will show if the variable is false {% endif %}
- Unless Statements:
{% unless variable_name %} This will show if the variable is false {% endunless %}
Example with Logic
{% if no_other_conversations %}
This is your only active conversation.
{% elsif one_other_conversation %}
You have one other active conversation.
{% else %}
You have {{other_conversation_count}} other active conversations.
{% endif %}
Example Templates
Welcome Message with Conditional Logic
Hi {{advocate_first_name}}! Welcome to {{community_name}}.
Your profile is now active. You can view and edit it here:
{{advocate_profile_url}}
{% if is_current_relay_target %}
You are currently the active relay target for your community.
{% endif %}
New Conversation Alert with Context
Hi {{advocate_first_name}}, you have a new message from {{prospect_public_name}}:
{{message_content}}
Reply directly to this message or view the conversation here:
{{advocate_conversation_url}}
{% if many_other_conversations %}
You have {{other_conversation_count}} other active conversations with: {{other_conversation_prospect_names}}
{% endif %}
Best Practices
- Keep it Personal: Use variables like
{{advocate_first_name}}
or{{prospect_first_name}}
to make messages feel more personal - Be Clear: Always include clear calls to action with the appropriate URL variables
- Test Your Templates: Make sure to test your templates to ensure all variables are working correctly
- Keep it Concise: Shorter messages are more likely to be read and understood
- Use Appropriate Context: Some variables are only available in certain situations (like conversation variables only being available in conversation messages)
- Use Conditional Logic: Use
if
statements to show different content based on the context - Test Edge Cases: Make sure your templates work well in all possible scenarios