Skip to main content

How can I create HTML emails in Lasernet? - Knowledgebase / Lasernet / Lasernet FAQs - Formpipe Support Portal

How can I create HTML emails in Lasernet?

Authors list

HTML can be used to create more complex and visual emails. The HTML body is controlled by the JobInfo called MailBodyHTML.

The following Form configurations will require a basic setup of Input, Mail Output and Form Engine modules. 

Use Dataset and XHTML

When you create a form, you can choose XHTML for RichText Output which enhances the mail merge process.

How to populate the JobInfo MailBodyHTML on the Mail Output?

To populate the JobInfo MailBodyHTML on the Mail Output, follow these steps:

1. From Lasernet Developer, open the Mail Output Module to edit the settings for the module.

2. Navigate to the JobInfos tab and click Add

This allows us to call and manipulate the JobInfos that the module will use.

3. In the pop-up window select MailBodyHTML as the JobInfo Name.

4. Insert the HTML code as the JobInfo value and confirm changes by clicking OK. In this example, the following is being used:


Once a job has been processed in the Mail Output Module, the email sent to recipients will display the HTML-generated page. It is also possible to use further HTML elements to show up images, tables, URLs, etc.


Can I use dynamic data in the HTML?

Dynamic data can be inserted into the mail body either via a script or JobInfo substitution. In the example below a JobInfo is being picked up which has already been created within a Form and a JobInfo substitution is used to insert it into the mail body.

The declaration to use HTML in the mail body has been made and a paragraph containing the words “Good Morning #CustomerName#,”  has been set.

The Customername JobInfo is used to dynamically add the customer's name to the email body. The JobInfo referenced in the HTML body must exist and contain a value before getting to the Email Output as mentioned.

For Lasernet to be able to reference the dynamic data, you need to enclose the JobInfo name with hashtags: #Customername#. This will retrieve the value of this JobInfo and apply it to the email; if the JobInfo is an array it will retrieve the first value in the array.

How to set this up with Sheet Embedding? [ Lasernet 8+ only]

Version 8 introduced multiple advanced output formats including XHTML so you can define the HTML body of our outgoing email in Form Editor. This allows you to edit and populate the HTML to put into the MailBodyHTML JobInfo. Sheet embedding means the contents of the sheet are stored in a specified JobInfo to be available for the next sheet.

Create the Form

1. Navigate to your Form Engine and Add a new Form.

2. Give your Form a Name and optionally a Description.

3. Select the Input Format as Dataset from the drop-down list.

4. Select the Output Format as XHTML.

5. Press OK.

Prepare the Form in the Form Editor

1. Open the Form and select a Grab file.

2. Add a Form criterion.

3. Create or open the XHTML Template on the right. The Template view is for creating the output/structure of the XHTML page using the built-in tools to create Tables, Headers, Shapes, etc. These objects can be easily formatted.

It is possible to import an already existing template. Use the Open Template button and select the XHTML file you would like to use.

Set up a Rearrange

1. Switch back to the XHTML view on the right to see the structure of the document.

2. Choose the Rearrange tool and select the data you would like to pick up.

3. Double click or right-click properties to edit the rearrange settings.

4. On the output settings for the Rearrange, assign this Rearrange to the output below the header (this can be different in your XHTML Template) and confirm changes by clicking OK.

The example below shows the Rearrange being added to a table.

5. Check your output by clicking on the Preview button on the upper left-hand side. You should see your Rearrange added to the output.

Set up Sheet Embedding

1. Create a second Sheet by right-clicking on the Sheet tab (or Form > Define Sheets in top menu) and selecting Add. This sheet will be your document to be attached to the email.

2. Set the Destination on the new Sheet to your Mail Output module.

3. Switch back to the first Sheet and open Sheet Options: right-click on the Sheet tab ( or Sheet > Sheet Options in the top menu).

4. Navigate to Combining and enable JobInfo: MailBodyHTML option as seen below. The content of the sheet is stored in the selected JobInfo and available for

the next sheet(s), the settings for destinations are ignored and no output job is created.

Set a filename on the attachment

1. Open the second sheet options and click Post JobInfos.

2. Add a ‘Filename’ JobInfo with a value including the extension

Set a mail subject

1. Open the second sheet options and click Post JobInfos.

2. Add a ‘MailSubject’ JobInfo with a value of the email subject.

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?