LB Templates

LB Templates is Logic Builder extension for generating HTML templates. HTML Templates can contain formatted text, images, links, data from Sugar, and more.

Templates from LB Templates can be used:

  • To compose a Body of an Email to be sent from Logic Builder
  • To compose PDF documents with Logic Builder
  • To populate the event message in the Timeline Viewer
  • To fill any HTML-type fields with HTML created from a Template
  • To prepare HTML text and then transfer it to the 3d party system

Below is an example of a Template and TimelineViewer message that is composed based on the Template:

How to create a new Template?

Once LB Templates extension is deployed into Sugar, the new module LB Templated is added. To create a new template, navigate to the LB Templates module and select Create LB Template:

Then provide the following data:

Name – input the name of your template.

Template – input template content. Simply input template body, using variables (see Context below) and TinyMCE functions:

ButtonDescription
Bypass the rich-text editor options and insert your own HTML code, or view the HTML code of an existing template to make advanced changes.
Use these basic font formatting options to add common styles to text in the message body.
Set paragraph alignment.
Choose a custom font color or highlight text with a background font color.
Make text larger or smaller.
Remove any formatting
Insert or edit an image
Insert, edit or remove a link.
Insert a table

Engine Type – select Base or Smarty:

  • Base is a simple template that allows you to use variables, pictures, links in the template.
  • Smarty has all the features of Base templates but also allows you to use conditional formatting in the template (for example, use if/then constructs)
    You can learn more about Smarty features here: http://www.smarty.net/docsv2/en/

Context – input variables that will be filled with values during template processing based on mapping “variable – value” in the flowchart. For example, contact first name, case number, opportunity amount, and so on.

Enter the name of the variable in the field. The variables’ names are depend on the selected Engine Type::

  • For Base there are no restrictions on variable naming.
  • For Smarty the variable name must contain only the characters [a-z], [A-Z], [0-9] and [_]

To add another variable, click the “+” button:

To remove a variable, click the “-” button.

To add a variable to the editor text, click the “play” button:

Variables in Base Templates are specified in double curly braces: {​​{​​​​​​​​​variable}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Variables in Smarty Templates are specified in curly braces and with the $ symbol: {​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​$variable}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Example of the Template that notifies Customer on Case Status change:

Example of mapping “variable – value” in the flowchart:

How to Use Templates?

A template is used in Logic Builder to generate HTML text based on a template.

To process templates use the operator Get HTML Text From Template.

 Created from a Template HTML can be used as:

  • input to Set Entity Attributes for HTML-type fields
  • passed through REST API
  • input to text in Send Email operator
  • input in html in Get PDF File From HTML
  • as rich-text message in Create TLV Record

Please navigate to the description of each of the operators to find out how to use them.

Example of the flowchart where the Template is used for composing Email Body:

Example of processed Template:

How to Change Template?

 You can make changes to existing Templates – change the template text, add new variables, remove variables, etc.

Note: After adding a new variable to LB Template, you need to map this variable to data in Logic Builder.

If some static text/image etc was added to the template, there is no need to make any change to the flowchart that processes this template.

Can I Export and Import LB Templates Records?

Yes, you can perform standard export and import procedures to move LB Templates from sandbox to production.

The following fields must be imported:

  • ID – selected template in Get HTML Text From Template operator is mapped to the LB Templates Sugar record by record ID. Therefore, when transferring templates, it is necessary to transfer the record along with the ID
  • Name
  • Context
  • Template

Note: if there are any pictures in the template, make sure that these pictures are available from the new instance.

Can I apply to LB Templates records Role restrictions?

Yes, standard Roles Configuration can be applied to the module LB Templates.

Click to rate this post!
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published. Required fields are marked *