Designing Body Template

 

1 About Body Template
2 Using Body Template Editor
2.1 Using Context Menu in Body Template Editor
2.2 Inserting Charts Into HTML Body Template
2.3 Inserting SQL Fields Into Body Template
2.4 Inserting SQL Table Into HTML Body Template
2.5 Insert Pre-Designed Excel Table Into HTML Body Template

1 About Body Template

You can design the email body template in the task editor. The system will generate the email body based on the template you designed. In an Interactive Query task, the body template will be displayed on the interface as a query result.

The body templates for "HTML Email" and "Interactive Query" tasks can incorporate text, tables, charts, and images, while the body template for "Text Email" tasks is restricted to text content only.

HTML body template

The HTML email body generated after the task execution

2 Using Body Template Editor

You can design the body template of the task in the body template editor of the task editor.

The HTML body template editor

2.1 Using Context Menu in Body Template Editor

You can use the context menu in the Body Template Editor to insert variables, SQL fields or other contents into the body template.

Right click on the Body Template Editor to show the context menu

Cut

Cut the selected content to the clipboard.

Copy

Copy the selected content to the clipboard.

Paste

Paste the clipboard content to the current location. This feature needs to be used in the console program (easyconsole.exe).

Select the table where the element is located

(HTML Body only) If the currently selected HTML element is within a Table, clicking this menu item will select the Table that the element is in.

Select the table where the element is located

Insert Horizontal Line

(HTML Body only) Insert a horizontal line at the current position.

Insert Image

(HTML Body only) Insert images at the current position.

Insert Pre-Designed Table From File

(HTML Body only) Insert a pre-designed Excel table at the current position.

The Excel table will be converted into an HTML table and displayed at the current position. You can add data cells to the Excel table and then let the system display the results of SQL queries in those cells.

Insert Pre-Designed Excel Table Into HTML Body Template

Insert Chart From Attachment Template

(HTML Body only) Insert a chart from an attachment template.

Inserting Charts Into HTML Body Template

Cell Properties

(HTML Body only) If the currently selected element is a cell in a table, you can use this menu item to set the properties of the cell such as background color, text color, etc.

Cell Properties dialog box

Insert Variable

Insert a variable at the current position. When the task is executed, the value of the corresponding variable will be displayed in this position.

Using Variables in Tasks

Insert SQL Fields

Insert the query result field of an SQL statement at the currently selected location. The system will display the text of the corresponding SQL statement's query result here.

Note: Only the text of the SQL query results will be displayed here, and the query results will not be displayed as a table. If you want to display the query results as HTML table, please use the "Insert SQL Table" menu item.

Inserting SQL Fields Into Body Template

Insert SQL Table

(HTML Body only) Convert an SQL query result into a Simple Table and display it at the currently selected location.

Displaying an SQL query result as a Simple Table in the HTML body

Using Simple Tables

Edit SQL Statement

(HTML Body only) Editing the SQL statement that corresponds to the SQL field or SQL table.

Disable Table

(HTML Body only) Disable the selected Simple Table.

Note: Once the table is disabled, the corresponding SQL statement for the table will no longer be executed.

Enable Table

(HTML Body only) Enable the selected Simple Table.

2.2 Inserting Charts Into HTML Body Template

You can insert a chart from a custom Excel attachment template into the selected location of the HTML body template. During the task execution, the corresponding chart from the Excel attachment file will be displayed in the HTML body.

Tips: This feature requires Excel 2010 or a later version to be installed on your computer.

(1) Design a chart in an Excel sheet, set up the data cells, corresponding data series for the chart, and the chart style. Using Custom Excel Templates

Design a chart in an Excel template

(2) Create an attachment template in SQLMessenger, select the template type "Customize Spreadsheet Template," and import the designed Excel spreadsheet file.

Create attachment template in SQLMessenger

(3) Add SQL query statements to the attachment template and establish the relationship between SQL fields and the data cells in the Excel template.

Add SQL query statements to the attachment template

(4) Insert the chart into the HTML body template in the editor.

Insert the chart into the HTML body

The HTML body generated by the task

Using Custom Excel Templates, Using Data Cell

2.3 Inserting SQL Fields Into Body Template

Insert the query result field of an SQL statement at the currently selected location. The system will display the text of the corresponding SQL statement's query result here.

You can right-click where you need to insert SQL fields in the editor, then click the "Insert SQL Fields" menu item in the context menu and follow the wizard prompts to enter the SQL query and select the SQL fields to insert.

Click the "Insert SQL Fields" menu item in the context menu

Insert SQL Fields Wizard

The body content generated by the task

2.4 Inserting SQL Table Into HTML Body Template

You can convert the query result of an SQL statement into a Simple Table and display it in the HTML body.

Display SQL query result as an HTML table

Convert Query Results Into HTML Table

2.5 Insert Pre-Designed Excel Table Into HTML Body Template

In SQLMessenger, you can insert a pre-designed Excel table at the current position. The Excel table will be converted into an HTML table and displayed at the current position. You can add data cells to the Excel table and then let the system display the results of SQL queries in those cells.

Insert a pre-designed Excel table into the HTML body template

The HTML body content generated by the task

Using Custom Excel Templates, Using Data Cell