
How to use variables in message templates and signatures
Overview
Variables are placeholder text in message templates or signatures that are dynamically filled based on information you've provided. This allows you to easily manage message templates and signatures at the company level.
When you set up a message template or signature with variables and use them in a reply, Front will automatically scan and pull from the saved contact details of your recipient or any custom field data.
Variable options
Default variables
Front has default variables that will populate from the fields of your saved Contacts. To use a variable, simply type two double curly brackets {{ when composing a new message template or signature. The list of variables will appear, and you can select the one you'd like to use.
The current list of default variables are:
- account.name: name of the contact currently tied to the account
- conversation.id: numeric version of the conversation's id
- conversation.public_id: id available in app menus (eg. cnv_123abc)
- message.id: numeric version of the message's id
- message.public_id: id available in app menus (eg. cnv_123abc)
- recipient.handle: contact's handle (ie. email, phone, etc.) dependent on message type
- recipient.email: contact's email address
- recipient.twitter: contact's Twitter handle
- recipient.phone: contact's phone number
- recipient.name: contact's full name
- recipient.first_name: first part of contact's name, split on the first space
- recipient.last_name: remaining portion of contact's name following the first space
- recipient.link: contact's link attribute
- survey: inserts Front's CSAT feature
- user.id: current Front user's numeric id
- user.name: current Front user's full name (first + last)
- user.first_name: current Front user's first name
- user.last_name: current Front user's last name
- user.email: current Front user's email
Custom contact variables
Front's Contact Manager allows you to add your own custom fields for your contacts, such as a Customer ID or a Job Title.
To use custom contact fields in your message templates or signatures, type the two double curly brackets {{ and recipient.custom in the message template/signature composer. You will see any custom contact fields you have created. For example, the custom contact field named Customer ID will appear as recipient.custom.customer_id.
Custom account variables
Front allows you to add your own custom fields to your accounts, such as an Account Manager or an Account Tier.
To use custom account fields in your message templates or signatures, type the two double curly brackets {{ and account.custom in the message template/signature composer. You will see any custom account fields you have created. For example, the custom account field named Account Manager will appear as account.custom.account_manager.
Custom teammate variables
Front allows you to add your own custom fields to your teammates, such as a Manager or Job Title.
To use custom teammate fields in your message templates or signatures, type the two double curly brackets {{ and user.custom in the message template/signature composer. You will see any custom account fields you have created. For example, the custom account field named Job Title will appear as user.custom.job_title.
FAQ
What if the contact or field doesn't exist?
If the recipient name does not exist in your Contacts, the variable will not populate in your message template, in which case you should define a fallback. When defining a fallback, make sure you surround it with single quotes:
{{recipient.first_name | 'there'}}
How does Front populate custom account variables?
Front will populate the custom account data for the recipient in the From field of your composer. The recipient needs to exist in your Contact Manager and be connected to an account. If there are multiple recipients, Front will populate the account data based on the logic described below.
Do variables work with automatic replies?
If you are using message templates in rules to send automatic replies, the {{user...}} variables, which is the Front teammate sending the message, will be blank because no user is actually tied to the reply, as it is automatic.
Do variables work in the subject line?
When you insert a message template manually in your message, the variable will work in the body, but not in the subject if you have one set up in the subject.
However, when a rule automatically sends a message template with a variable in the subject line, the variable will work in the subject.
Do recipient variables work for multiple recipients?
If you have multiple recipients you're writing to, dynamic variables will only populate the first recipient in the list, rather than separate copies to each recipient with their name populated. If you need to send separate copies with unique variables for each recipient, you should use Sequences.
-
Ben Leon For SMS, dynamic variables only work through canned responses. As for the contact information (state, address,etc.), dynamic variables are limited to the ones listed when you type "{{" (see screenshot from this article). Therefore, you cannot pull information from contact details for your dynamic variable.
-
It seems like there is quite a bit of support for being able to use custom fields in variables in canned responses but the concept doesn't appear to be anywhere in Trello 'ideas and requests' for people to upvote or comment on (if commenting were enabled).
The Trello board encourages people to make suggestions, but many I've seen in this forum or made directly as suggested don't seem to show up there.
-
Hi @john_fabrega we try to keep the board up to date as much as possible. However we are always working on a ton of smaller improvements and tracking all of them on Trello would be impossible to keep up. :) You can however always forward your suggestion to us via the forum here or directly via support@frontapp.com and we will be sure to forward them to the product team for you.
-
In the new Front, it seems that the variables in canned responses have taken a step backwards. We've noticed that the indication of the variable positioning (formerly a blue shading) is gone so one has to hunt around to determine if the correct -or any- variable was inserted. Due to the lack of ability to include custom variables as discussed above, we used unused fields to remind us to manually enter information where needed. Now there is nothing to help us find the locations. Furthermore, if one wants to change what was automatically inserted as a variable, one has to individually delete each character rather than the full block.
Really hoping for a high priority fix to this issue.
-
Joe Hemsing It seems like a number of things broke in the update related to canned responses:
- Variables in Subject lines not working.
- Custom subject lines from canned responses are not automatically displayed.
- Variables within canned responses no longer leave noticeable placeholders when there is no data in the field
- (Never worked) Custom fields aren't available for variables in canned response.
As Kenji suggested above, make sure to also reach out to support to pile on to the requests.
Crossing fingers that it will make it on the roadmap soon.