Skip to main content

Templating — the basics

You don't need to be a developer to understand templates. If you've ever used a mail-merge to send the same letter to a hundred people — each one greeting the reader by name — you already know the idea.

A template is a piece of text you write once, with a few blanks in it. SHIPM8 fills in those blanks automatically, using the data for each ship, customer, or port call.

Placeholders

The blanks are called placeholders, and you write them with double curly braces: {{ }}. When the template runs, each placeholder is swapped for a real value.

Here's a port-call notification:

Dear {{customer.name}},

Your vessel {{vessel.name}} is expected at {{port.name}} on {{eta}}.

Combined with the data for one port call, it becomes:

Dear Blue Tide Shipping,

Your vessel Ocean Star is expected at Amsterdam on 22-07-2025.

Same template, different data, a different message every time. That's the whole idea — everything else builds on it.

Where SHIPM8 uses templates

Templates power the text that SHIPM8 generates for you, including:

  • Notifications — the emails and messages sent for events like an updated ETA.
  • Invoices — the layout and wording of invoice documents.
  • Exports — Word, PDF, Excel and other documents produced from your data.

Wherever you can edit one of these, you're editing a template.

A bit more than placeholders

Most of the time, placeholders are all you need. But sometimes a raw value isn't quite presentable — a date stored as 2025-07-22T00:00:00, or an amount that should read € 1.250,00. For those cases the engine offers helpers that format and reshape values, for example:

{{dateFormat eta 'dd-MM-yyyy'}}      →  22-07-2025
{{currencyFormat amount 'EUR'}} → EUR 1.250,00

There are helpers for dates, money, text, lists, simple "if this, then that" logic, and more. You don't need them to get started — when you do, the rest of this section is a full reference, grouped by what you're trying to do.

Try it out: the Playground

The best way to learn is to experiment, and SHIPM8 has a safe place to do exactly that. In the Content Distribution area (shown as Data export in the Dutch menu) you'll find the Templating Playground.

There you can paste a template on one side and some sample data (in JSON) on the other, click Apply, and instantly see the result — without touching any real notification or invoice. It's the easiest way to try an example from these pages and watch what it does.

tip

If you don't see the Content Distribution area, your account may not have access to it. Ask your administrator if you'd like to use the Playground.

Where to next

  • Writing templates — placeholders, loops, and how to reach into nested data.
  • Selecting data with JSONPath — how to point at exactly the field you want, including names with spaces.
  • The remaining pages are a reference for the formatting, list, logic, and calculation helpers — dip in when you need them.