Guides & product help, fjellride.se

Back to Account & Settings

Building document templates

How to create and customize document templates for contracts, invoices, and other rental documents using HTML and Handlebars.

What a document template is

A document template sets the layout and content of the contracts, invoices, packing slips and other documents you create from bookings. Templates are HTML with Handlebars variables, which Fjellride fills in with the booking's data.

All templates live on Settings → Templates, in the Communications group. Use the Kind filter to show only document templates.

The Templates page with email and document templates
The Templates page with email and document templates

Your rental terms, cancellation policy and privacy policy are document templates too. You write those from Settings → Policies, see Policies and your About page.

Creating a template

  1. Go to Settings → Templates.
  2. Click Create Template and choose Document Template.
  3. Under Template settings, fill in:
    • Name
    • Type: Contract, Packing slip, Order summary, Invoice, Receipt or Custom
    • Description (optional)
    • Active and Default. The default template of a type is pre-selected when your team creates a document.
  4. Write the template on the Code tab and check it on the Preview tab, which fills it with sample data.
  5. Save.

Fjellride also ships ready-made templates. They're read-only. Click Customize to make your own copy, and Reset to automatic to go back to the ready-made version.

Writing the template

You write HTML directly, with Handlebars expressions for booking data. Write only the content: no doctype and no body tag.

html
<h1>Rental agreement</h1>
<p>Customer: {{customerName}}</p>
<p>Booking #{{bookingNumber}}</p>
<p>Period: {{startDate}} to {{endDate}}</p>

<h2>Items</h2>
<table>
  <tr>
    <th>Item</th>
    <th>Quantity</th>
    <th>Price</th>
  </tr>
  {{#each items}}
  <tr>
    <td>{{description}}</td>
    <td>{{quantity}}</td>
    <td>{{price}}</td>
  </tr>
  {{/each}}
</table>

Style the document with a <style> block or inline style attributes in the HTML.

Template variables

Variables are replaced with the booking's data when a document is created. The syntax is {{variableName}}.

Common variables

  • {{customerName}}: the customer's full name
  • {{bookingNumber}}: the booking reference
  • {{startDate}} and {{endDate}}: the rental dates
  • {{totalPrice}}: the booking total
  • {{pickupLocation}} and {{returnLocation}}: location names
  • {{organizationName}}: your business name

The Available variables panel in the editor lists the rest, including invoice and contract numbers, fees, discounts and your brand colors.

Loops and conditions

handlebars
{{#each items}}
  <p>{{description}}, quantity {{quantity}}</p>
{{/each}}

{{#if bookingNotes}}
  <p>Notes: {{bookingNotes}}</p>
{{/if}}

Using AI

With AI features turned on, the Code tab has two buttons:

  • Generate with AI writes a first draft from the template's name and description.
  • Improve with AI reworks the template you have.

The result opens in a review dialog first, so you can read and adjust the HTML before it replaces yours. If the code has errors, Copy for AI copies the error list so you can ask an assistant to fix them.

Testing a template

  1. Open a booking.
  2. In the Documents section, click Create document and pick your template.
  3. Read the result.

The document can be printed, shared by link or emailed to the customer.

Tips

  • Keep the layout simple. Headings, tables and lists print well.
  • Test with a booking that has several products, long names and a discount.
  • Set one template per type as Default so your team doesn't have to choose each time.