Spanish Total.js
English
Documentation For AI agents
Contents

Introduction

What OpenTemplates is, what it does and where to start.

.md GitHub
On this page

OpenTemplates keeps the HTML templates of your documents, such as invoices, contracts or letters, in one place. Your other apps send it the data of a document, and OpenTemplates answers with the finished HTML. With a Total.js API token it can also print the document as PDF, DOCX or JPG.

OpenTemplates is an official Total.js app under the MIT license. The code is on GitHub.

What you can do

  • Group your templates in profiles, for example one profile per project or customer.
  • Give every profile a layout: the HTML page around its templates, with shared styles and helpers.
  • Write templates in HTML with a live preview, a sample model and your own helpers.
  • Let each app render templates with its own API token.
  • See every render in the Logs.
  • Export profiles and templates as JSON files and import them on another server.

How it fits together

  1. You create a profile with the identifier demo.
  2. In that profile you create a template with the identifier invoice and write its HTML.
  3. You create an API token for your app.
  4. Your app sends {"id":"demo/invoice","data":{...}} to OpenTemplates with the token.
  5. OpenTemplates fills the template with the data, puts it into the layout and answers with the HTML.

Where to go next

Made in Europe