We are using Liquid template language in our Job messaging, Agreements, and several other places in Tap Inspect. This allows the use of value substitutions and conditional logic to create very powerful and flexible templates.
The most common and basic of the tags are displayed in the Insert Values drop down menu while editing in many places of Tap Inspect.
Additional tags and more complex logic can be achieved by using Liquid markup directly in the body or the subject of a message.
Job
Example: Only include this statement if a 'radon test' service is included in this job. The tag must exactly match the name of the service. Only letters and numbers are matched.
{% if job.includes_radon_test %}
The radon test will require scheduling a drop off or pick up of the radon testing equipment.
{% endif %}
Services
Example: List the name and the total price of each service included in this job.
{% for service in job.services %}
{{service.title}} : {{service.total_price}}
{% endfor %}
Example: Only list the total price of a specific service (ie "Residential Home Inspection") included in this job. Note: The service.title must exactly match the title of the service.
{% for service in job.services %}
{% if service.title == "Residential Home Inspection" %}
{{service.title}} : {{service.total_price}}
{% endif %}
{% endfor %}
Person
The properties of a Person object can be accessed by name. When a person has more than on email or phone, the first is displayed.
{{selling_agent.first_name}} {{selling_agent.last_name}}
{{selling_agent.org}}
{{selling_agent.address}}
{{selling_agent.role}}
{{selling_agent.email}}
{{selling_agent.phone}}
Emails
When multiple emails are present for a person they can be iterated and displayed.
{%for email in selling_agent.emails%}
{{email}}
{% endfor %}
Phone Numbers
When multiple phone numbers are present for a person they can be iterated and displayed.
{%for phone in selling_agent.phones%}
{{phone}}
{% endfor %}
Company
Access the individual pieces of contact information for a company.
{{company.name}}
{{company.phone}}
{{company.url}}
{{company.street}}
{{company.street2}}
{{company.city}}
{{company.state}}
{{company.zip}}
{{company.country}}
Display the company's full address in one tag, for example:
123 Main St.
Chicago, IL 12345
{{company.address}}
Or display the company's full address as a single line:
123 Main St., Chicago, IL 12345
{{company.single_line_address}}
You can also display all of your contact information in the same order that appears on your company profile settings with a single tag:
{{company.contact_information}}
Inspector
Access individual pieces of information for the inspector in a job
{{inspector.full_name}}
{{inspector.first_name}}
{{inspector.last_name}}
{{inspector.email}}
Dates
We do not provide direct access to 'today' or 'now' but they can accessed using Liquid date functions.
{{"today" | date: "%B %e, %Y"}} -- "July 22, 2020"
{{"now" | date: "%Y-%m-%d %H:%M"}} -- "2020-07-22 17:48"
Invoices
Access individual pieces of information from the invoice for a job
{{invoice.number}}
{{invoice.issued_at}}
{{invoice.due_at}}
{{invoice.total_price}}
{{invoice.amount_due}}
Comments
0 comments
Please sign in to leave a comment.