by CM & Sugar

Create dynamic documents by your given compliance templates. Supports open document formats and ms-office formats. Convert any data into any document for download or activity stream. Output remain in the original format or open PDF.

Free 30 day trial
Try it Now

User Guide

This CMS Document Templates plug-in uses the TBS (TinyButStrong) open library for linking office files together with your CRM data. The TBS library is a template engine that allows you to generate documents from templates in various formats, including Microsoft Word. If you want to know more about TBS, visit the TBS homepage and check out the manual section.

Step 1: Define a new Document Template CRM Container

  1. Go to Administration -> Document Templates (List) -> Create Template

Define your template meta information. Your will have to define the aimed module and the wanted fields. Upload the template file. You can upload any time a newer version. Be aware by downloading the current file, it keeps the internal ID (36 sings) within the filename. You will have to remove it, if you want to upload the same file again. Replace "ID_" of "ID_example.docx" to "example.docx".

You can define any output filename pattern and combine it with date time information. This would be helpful to replace / add any downloaded file by the creation date.

  1. Save that template record and watch the stored setup. Now you can copy from "Used vars in document" and paste those placeholders directly into your template.

  2. Edit that template, if you need to update the actual template file (Step 2).

Create / Edit Document Template Container Screenshot from 2025-08-12 12-42-21.png

Saved Document Template Container and its used placeholders Screenshot from 2025-08-12 12-42-12.png

Step 2: Create an Office Template

  1. Open Office and create a new document.

  2. Design your template, including placeholders for dynamic data. Use the TBS syntax for placeholders. For example:

  • Use [first_name] for the first name of a user.

  • Use [last_name] for the last name.

  • Any fields that are not associated or do not exist, will be ignored. Empty values will be pasted into the assigned placeholder. An example of a simple template could be:

Welcome to our service, [first_name] [last_name]!

   Best, 
   The Team

Placeholders can be styled, but never edited or reformatted. Sometimes Office applies hidden format information onto placeholders. Therefore it is recommend, to copy placeholders from the saved Document Template record and paste them plain as unformatted text (CTRL+SHIFT+V)

  1. Save your template as a .docx file, say template.docx. and upload into your CRM (Step 1)

Example Letter for Contacts Module Screenshot from 2025-08-12 13-48-01.png

Step 3: Generate a new Document Template

  1. Go the aimed module (e.g. Contacts), open any record and check out for the "Generate Document" button. Usually it will be attached to the "Actions" menu buttons on top.

  2. Click that button, choose the uploaded template (there can be more than one), check the export settings

  3. Generate the document. The output will show a tiny popup and provide a link for downloading it. Created documents can be attached to Notes and directly send by E-Mail

  4. The add-on will generate an output file according to your defined setup (Step 1) and fills in the placeholders.

Screenshot from 2025-08-12 12-41-28.png

Screenshot from 2025-08-12 12-41-57.png

Screenshot from 2025-08-12 13-54-23.png

Step 4: Validate the Output

  1. Open the generated output file. Choose either the origin format or convert into PDF.

  2. Check if the placeholders have been successfully replaced with the corresponding data.

  3. Modify and repeat

Screenshot from 2025-08-12 13-54-43.png

Notes

  • Ensure your web server has sufficient permissions to read and write files in the directory where you’ve placed the template and script.

  • You can customize the output further, format date fields, and perform more complicated manipulations as per the TBS documentation.

  • There is support for direct relationships to any other module and followed up by an indirect relationship to a second module. Be aware, there is a logical restriction to export more than one related record and its data into one field. You will have to create special Document Template Variables.

  • You can include more complex logic / blocks / collections and even multiply datasets by using the the Document Template Variables module .

Go to Administration -> Document Template Variable (List) -> Create Variable

Define the custom Variable by adding a special and unique name for its internal block within the template file, any display label and the aimed module, where you will need that special logic. If you are not a SuiteCRM expert, please consider us for more support. You will need deep knowledge of SuiteCRM plus a concrete idea of your wanted data structure for the template export.

The "Code" field is based on SuiteCRM tinymce editor. You can use an integrated code editor for PHP. Any code is executed and straight forward interpreted. Only grant trustful user / administrators access to this section! There is no warranty for malicious code fragments.

Choose PHP language support for easier usebility Screenshot from 2025-08-12 14-15-06.png

Check and Save your defined block logic for any wanted module Screenshot from 2025-08-12 14-13-35.png

Now you can use that Variable at Quotes and Invoices module identified by "products" at "Module Fields" at the bottom grouped by custom fields. The technical field for your template can be copied from the Document Template Container placeholders. Here it would be "_LRM_product_items_quotes" Screenshot from 2025-08-12 14-18-06.png

More detailed information about all your possibilities can be found at TBS. CM & Sugar also provides support to you creating your individual templates.

Saving Comment Saving Comment...