Configure an HTML document template
Create or modify the document template with your unique company logo and audience criteria.
Before you begin
Role required: sn_doc.admin and Delegated developer
About this task
[Omitted video] Description: Configure an HTML document template
Procedure
Navigate to All > Document Templates > All Document Templates.
Select New.
Select HTML Document Template.
On the form, fill in the fields.
| Field | Description |
|---|---|
| Name | Name of the document template. |
| Table | Table associated with the type of template. The table determines the available variables that can be used.Note: Tables appear based on the application scope that is selected. |
| Category | Document category in which the template is added. |
| User criteria | Audience criteria for this document. For example, you can create a letter intended for only Canadian employees.Note: When defining conditions like case sensitivity or null values, see API GlideFilter - Scoped, Global. |
| Body | Text in the template.To insert variables, place your cursor in the desired location and select the variable. Available variables are listed under Fields. Document template styles are applied to regular text fields, and not for rich description fields. A rich description field preserves its own HTML formatting and style and is not overridden by the document template formatting and style. Use the formatting tools in the Body to apply formatting options, such as bold, italic, underline, font styling. The body is a place holder for HTML text and tokenized variables. Note:
|
| Start date | Date starting which the HTML document template is valid. Start date helps in maintaining multiple versions of same template.Note: Start date must be before the end date. |
| End date | Date until which the HTML document template is valid. End date helps in maintaining multiple versions of same template.By default, if the values in Start date and End date are empty it will imply that the template will always be valid. If you specify an end date, you must also specify a start date. |
| Template date format | Format in which you want the date to appear when an agent previews the document, generates the attachment, or initiates document tasks for participants.Note:
|
| Sanitize | Option to remove potentially unsafe HTML from template-generated content. The Sanitize option is hidden by default; users with the Note: Always enable the Sanitize option to secure your HTML templates. The sanitization happens using the default HTML sanitizer. See Exploring HTML sanitizer for more details. By default, the HTML sanitizer works by checking the built-in inclusion list for HTML markup. To make configuration changes (including or excluding HTML attributes or elements) to the HTML sanitizer, see Configuring HTML sanitizer. |
| Template language | Language in which you want dynamic tokens to be translated when an agent previews the document, generates the attachment, or initiates document tasks for participants. The Template language field is also used for full template translation.Note:
|
| Select variables | List of variables that can be used in the body of the template. Variables pull information from the selected table to customize the template.Offsets are supported for date variables. Offsets extend or subtract days, weeks, or months from a date used in a template. Valid date offset variables are:- + (plus) - - (minus) - d (days) - w (weeks) - m (months) Examples:
|
| Signing type | Option to specify the application that is used for signing the document. For example, ServiceNow Sign, DocuSign or AdobeSign.Note: Signing types are available only when the respective integration plugins are installed. |
| Header | |
| Header image | Image to be displayed in the header. You can add your company logo using this feature.Note: Supported file types are: JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, and JBIG2. |
| Header image position | Position where you want the header image to appear : left, right, or center. |
| Header image height | Height of the image in the header. Important:
|
| Footer | |
| Footer image | Image to be displayed in the footer.Note: Supported file types are: JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, and JBIG2. |
| Footer image height | Height of the image in the footer. Important:
|
| Footer image position | Position where you want the footer image to appear: left, right, or center. |
| Footer text | Text to be displayed in the footer. For example, you can add proprietary and confidential statements. |
| Footer text position | Position where you want the footer image to appear: left, right, or center. |
| Vertical alignment | Vertical alignment of the footer text with the footer image. |
| Page | |
| Page size | Size of the page that can be selected from the list such as Letter, A4, or Legal. |
| Custom font | Custom font from the PDF Generation Font Families table.Important: Make sure that you use the custom font family in the CSS of the HTML body. |
| Top/Bottom margin | Space from the top of the page until the starting of the HTML content or space from the bottom of the page until the ending of the HTML content. |
| Left/Right margin | Space from the left of the page until the starting of the HTML content or space from the right of the page until the ending of HTML content. |
Place the mouse in the desired location in the body of the template and select the Insert Date button to insert date variables.
You can use the button multiple times to add different types of dates based on the variables you choose.
Select Add blocks.
- To add an existing document block to the template, in Search blocks, type in the name of an existing document block, select the document block, and select Insert.
- To add a new document block to the template, click Create New Block. For more information, see Create document blocks in Document Templates.
To automatically generate Table of Contents (TOC) and page numbers in the document that is generated from an HTML template, perform the following steps:
In the Table of Contents field, select the TOC configuration that you want to apply on the HTML template.
- In the Page number field, select the page number configuration that you want to apply on the HTML template.
Select Insert Table of Contents and insert the Table of Contents macro in the required position in the body of the HTML template.
Note: The Table of Contents macro will not be displayed if the TOC configuration is not selected in the Table of Contents field.
To translate content in templates using Localization Framework, select Translate.
For more information, see Use Localization Framework for Document Templates.
To save your document and remain on the HTML Document Template form, click Save.
To save and return to the All Document Templates list, select Submit.