Create an email template with a flexible email body
- Last UpdatedMay 07, 2026
- 2 minute read
Create an email template where the text in the body of the email is generated from a predefined HTML template.
When you send emails for a concept (request for quote, purchase order, technical material requisition, and so on), if the email template selected for the concept is linked to a publish definition in the s00027 E-Mail Templates screen, then the body of the email is generated as formatted HTML content and you cannot manually edit the body of the email.
Prerequisites
Before you begin, complete the following:
-
In the s12003 View Definitions screen, in the Views grid, create a database view with the value in the Usage field defined as Queries. In the Fields grid, you can add all the required fields for the view.
-
To fetch the data to incorporate in the email, in the s12010 Data Extraction Manager screen, perform the following:
-
In the Queries grid, create a data extraction query with the value in the Type field defined as SQL on Views. Ensure the values in the Purpose field and the Category field are Publish and Data Extract, respectively.
-
On the s12010 menu, use the Edit functionality to create a query using the view you created in the s12003 View Definitions screen.
-
-
In the s12021 Razor Template Definition screen, perform the following:
-
In the Data Extraction Template grid, create a razor template with the value in the Purpose field defined as Publish.
-
On the s12021 menu, use the Edit functionality to create a query with the fields that are required for display in the flexible email body.
-
-
In the s12017 Publish Definition screen, use the data defined in steps 1–3 to create a data extract publish definition.
To create an email template with a flexible email body
-
Navigate to the s00027 E-Mail Templates screen.
-
To refresh the screen, select the F5 key.
-
In the Template Types grid, select a row.
-
Select the General tab, in the Entity dropdown, ensure the ID of an entity is selected.
The selected entity determines the context in which you can use the email and the information you can include in the email.
-
Select the Text tab and select anywhere in the Text grid.
-
On the Home menu, in the Record group, select Create.
In the Text grid, a blank row is created.
-
Select the General tab and perform the following:
-
From the Language dropdown, select a language code.
-
To use a predefined flexible email body in the email template, in the Text grid, from the Publish dropdown, select the ID of the required publish definition.
Note: To define multiple languages for an email template, repeat steps 6 and 7.
-
-
(Optional) Enter the relevant details in other fields as required. For more information on all the fields, see s00027 Field descriptions.
-
On the Home menu, in the Record group, select Save.
The email template is created with a flexible email body.