➤ Product: OfficeRnD Flex
➤ Who: Admins
➤ Where: Admin Portal, under Settings > Data & Extensibility > Templates
➤ Availability: All plans
Templates control the text and the layout of the emails that OfficeRnD sends. Templates also control the invoices and the contracts that OfficeRnD generates. If you do not edit the templates, every email and document uses the default OfficeRnD wording, without your branding or your terms. You can edit each template in a visual editor or directly in HTML code. You can also add data from your custom properties and show text only when a condition is true.
In this article:
Find each template type and test changes before members see them.
Change wording, formatting, and tables without code.
Copy the exact code for custom properties in emails, invoices, and contracts.
Show text only to some members or on some documents.
Restore the default version when a change breaks a template.
Find a template
All templates are under your organization's settings page. Each template type has its own section. For example, member email templates are in the Member Emails section.
To open a template:
Go to Settings > Data & Extensibility > Templates.
Open the section for the template type.
Open the template that you want to change.
The template opens with 2 views: Editor and Code. Both views change the same template.
Protect the original template
Changes to a template apply to every email or document that uses it. A mistake in the template therefore reaches all members at once. Test each change on a copy before changing the template in use.
To test a change on a copy of an invoice template or a contract template:
Open the template.
Click Clone. OfficeRnD creates a copy of the template.
Make your changes in the copy.
Generate a test document with the copy. For an invoice, open an invoice and click Generate PDF, then select the copy template.
When the test document is correct, apply the same changes to the original template, or use the copy instead.
Edit templates in the Editor
The Editor shows the template in the same way as the reader sees it. The Editor works like a word processor. Use the toolbar to format text and to add lists, links, and tables. The Editor keeps the template's HTML valid, so use the Editor for all wording and formatting changes.
Add tables with the table wizard
The Editor can also create a table. The Table Wizard creates a table from the details that you specify in its menu. For example, use a table to show a list of fees and their prices.
To add a table with the Table Wizard:
Click where the table must show in the template.
On the toolbar, click More Tools.
Click Add Table and select Table Wizard. The Table Wizard menu opens.
Specify the table details.
Click Ok. The Editor adds the table at the cursor.
Insert properties in email templates
A property is a placeholder for data that changes for each email or document, such as a date or a member name. In the Editor, a property shows in square brackets, for example [date]. When OfficeRnD sends the email or generates the document, it replaces the property with the real value.
To add a standard property in the Editor for an email template, just write the property in square brackets, for example: [bookingSummary].
Insert properties in invoice, contract, or order templates
To add a standard property in the Editor for invoice, contract, or order templates:
The Insert Property list does not show all properties. For the full list of available properties for each template type, see these articles:
Edit the template code
The Code view shows the template's HTML. Each change in the Editor also changes this HTML. In the Code view, a property shows in double curly brackets, for example {{ date }}.
Use the Code view for these 2 tasks:
To add a property that the Insert Property list does not show, such as a custom property.
To add logic that shows text only in some cases.
To add CSS to an invoice template or a contract template, use the Custom Code section of the template (applies only to templates for invoices, contracts, and orders). CSS you add elsewhere can break the document layout.
Add a custom property
A custom property is a field that you create for members, companies, locations, contracts, invoices, or bookings. The Insert Property list does not show custom properties. You must add them in the Code view.
To refer to a custom property, use its unique identifier. You can find the unique identifier in the custom property's settings. The unique identifier is case-sensitive. If 1 character is different, the property shows no value.
The code for a custom property depends on the template type. In each example, replace ID with the unique identifier of the custom property.
Template type | Custom property of | Code |
Member |
| |
Location |
| |
Email about a booking | Booking |
|
Invoice | Member or company |
|
Invoice | Invoice |
|
Contract | Member |
|
Contract | Company |
|
Contract | Contract |
|
Contract | Location |
|
For example, an invoice custom property has the unique identifier Amount Credited. The code for this property is {{ properties["Amount Credited"] }}.
The HTML of a long template can be difficult to read. To find the correct place for the property, use a marker:
In the Editor, type marker text where the property must show. For example, type
PROPERTY HERE.Open the Code view.
Find the marker text in the code.
Replace the marker text with the custom property code.
Show text only when a condition is true
Some text applies only to some members or documents. For example, a contract can show an extra paragraph only for contracts above a set amount. Templates use the Swig templating language for this logic. An if statement shows 1 text when a condition is true and another text when it is false.
Add if statements in the Code view:
{% if propertyName === value %}
Text that shows when propertyName is equal to value.
{% else %} Text that shows when propertyName has a different value.
{% endif %}The {% else %} part is optional. Without it, the template shows no text when the condition is false.
How you write the value depends on the type of the property:
Text: Put the value in quotation marks. For example:
propertyName === "Gold".Number: Write the number without quotation marks. You can also use
<,>,<=, and>=.
Some properties look like numbers but contain formatted text, such as a currency symbol. You can't compare text with a number. To convert this text to a number, use parseMoney.
For example, this code shows a sentence only for contracts with a total above 2000:
{% if parseMoney(contract.total) > 2000 %}
The contract costs more than 2000 per year.
{% endif %}To find out whether a property contains formatted text, add the property alone to a cloned template. Then generate a test document. If the value shows a currency symbol or separators, use parseMoney.
Revert a template to the default
If a change breaks a template, you can restore the default OfficeRnD version.
Warning: Revert removes all of your changes to the template, not only the last change. Before you revert, copy the code of any part that you want to keep.
To revert a template:
Best practices
If you paste text from a Word file or a PDF, paste it as plain text. Formatted text can bring hidden styles that break the template layout.
If you change only the wording, use the Editor, not the Code view. The Editor keeps the HTML valid.
If you need a large design change, request a template customization from OfficeRnD. Request a template customization →
FAQs
Why does a custom property show no value in the email or document?
A custom property shows no value when its code doesn't match the template type or unique identifier. Compare the code with the table in this article. Then compare each character of the unique identifier, including capital letters.
Why does my custom property not show in the Insert Property list?
The Insert Property list does not show custom properties. Add custom properties in the Code view.
Can I clone an email template?
You cannot clone an email template. Copy the email template code into a text file before you edit it so you can restore it.
Which templating language do templates use?
Templates use the SWIG templating language for properties and logic. Swig uses {{ }} for properties and {% %} for logic, such as if statements.









