How to edit templates - contracts, invoice documents and email

The following article applies to all types of templates.
Templates can be for emails, contracts and invoices.
You can find them in Settings->Templates - each type of template has its own section.

Whenever you open a template, there are two options to edit it - "Editor" and "Code".

Using the editor to edit templates

In the editor, you can see a preview that's easier to read and handle.
It works similarly to a regular text editor. 

Here are the functions of the editor:

  • Insert property - allows you to add some of the properties, that are available for the selected type of template.
    For a full list of all available properties, please visit the following articles:
  • Format - select the type of text you want to use:
    • Paragraph
    • Quotation
    • Heading 1 to Heading 6
  • Font Type
  • Font Size
  • Font Colour
  • Background Colour
  • Bold
  • Italic
  • Underline
  • Strikethrough
  • Alignments
    • Align left
    • Align center
    • Align right
    • Justify
  • Insert unordered list
  • Insert ordered list
  • Indent
  • Insert hyperlink
  • Subscript
  • Superscript
  • More tools
    • Clean formatting - removes all formatting for the selected text.
    • Table Wizard - allows you to create a table with the details that you've specified in the menu:
      s1.PNG

Editing the code of a template

If you click Code, you'll see what lies behind this preview - HTML code. Everything you do in the editor is translated into HTML. If you are familiar with it, you can do a lot, but for now, we are going to cover how to add properties directly in the code. Let's take a look at a default "Welcome" email template in code. 

2019-11-15_0047.png

If you notice, in the Editor view, the properties are shown in square brackets [property] and yellow color. In the code, they look like this: {{ property }}.
There are many properties that you can use, a lot of them can be added through the "insert property" in the editor, but not all are there.

You can find a list of available properties for the respective type of templates below:

Those lists are almost complete, with the major exception of this are custom properties.
The only way to insert a custom property is through the code and we'll cover this below.

How to add custom properties to templates

Custom properties are applied to different sections of the site. For example members, companies, locations etc.
In order to reference a custom property in the template you need to use its unique identifier:

s1.PNG

Depending on what the custom property applies to, you can reference them as follows:

  • Members - {{member.properties["Enter unique identifier"]}}
  • Companies - {{team.properties["Enter unique identifier"]}}
  • Invoices - {{properties["Enter unique identifier"]}}
  • Contracts - {{contract.properties["Enter unique identifier"]}}
  • Locations - {{location.properties["Enter unique identifier"]}}

Note: Member and companies properties when used on invoices are both replaced with customer.properties.

Example: The property from the screenshot has a unique identifier named "Amount Credited".
In order to reference the property you need to write {{properties["Amount Credited"]}} as it applies to invoices.

Note: The identifier has to be written identically as it's specified in the UI, propertes are case-sensitive.

If you already know where to place it and you can get around the code by yourself, then you can do it directly.
Another option is to go back to the editor, insert a placeholder string of text, e.g PROPERTY HERE and then switching back to code and finding where the property you just inserted is and replacing it. 

We advise that you clone your template using the Clone button and test with it before you edit your default template.

Note: Email templates cannot be cloned, so take care when editing those types of templates.

 

 

 

Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.