{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":11201,"path":"employee-service-management/hr-service-delivery/configure-HTML-doc-template.md","title":"Configure an HTML document template","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure an HTML document template\n\nCreate or modify the document template with your unique company logo and audience criteria.\n\n## Before you begin\n\nRole required: sn\\_doc.admin and Delegated developer\n\n## About this task\n\n\\[Omitted video\\] Description: Configure an HTML document template\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Document Templates** &gt; **All Document Templates**.\n\n2.  Select **New**.\n\n3.  Select **HTML Document Template**.\n\n4.  On the form, fill in the fields.\n\n<table id=\"table_dvm_fm3_zhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of the document template.\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\nTable 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.\n\n</td></tr><tr><td>\n\nCategory\n\n</td><td>\n\nDocument category in which the template is added.\n\n</td></tr><tr><td>\n\nUser criteria\n\n</td><td>\n\nAudience 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/server-api-reference/c_GlideFilterScopedAPI.md).\n\n</td></tr><tr><td>\n\nBody\n\n</td><td>\n\nText in the template.To insert variables, place your cursor in the desired location and select the variable. Available variables are listed under **Fields**.\n\nDocument 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.\n\nUse 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.\n\n **Note:**\n\n-   Jelly and CSS Styling are not supported.\n-   You can also use [Document template scripts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/hr-service-delivery/document-template-scripts.md) to dynamically change the text in the HTML body.\n**Note:** When the **Sanitize** option is enabled, final HTML generated after token replacement \\(field tokens, document template scripts, template blocks, and similar elements\\) is sanitized. Always enable the **Sanitize** option to secure your HTML templates.\n\n</td></tr><tr><td>\n\nStart date\n\n</td><td>\n\nDate 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.\n\n</td></tr><tr><td>\n\nEnd date\n\n</td><td>\n\nDate 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.\n\nIf you specify an end date, you must also specify a start date.\n\n</td></tr><tr><td>\n\nTemplate date format\n\n</td><td>\n\nFormat in which you want the date to appear when an agent previews the document, generates the attachment, or initiates document tasks for participants.**Note:**\n\n-   When signing using a ServiceNow application or the AdobeSign application: If no value is selected in **Template date format**, the value specified in the **template\\_date\\_format** system property is considered. If both **Template date format** and **template\\_date\\_format** system property are empty, the value in the Date format field from the agent's user profile is considered.\n-   When signing using a DocuSign application: The date format selected in Signing settings in the DocuSign application is considered over **Template date format** in the configured HTML template in a ServiceNow instance.\n\n\n</td></tr><tr><td>\n\nSanitize\n\n</td><td>\n\nOption to remove potentially unsafe HTML from template-generated content. The **Sanitize** option is hidden by default; users with the `sn_doc.admin` role can access by selecting the Advanced View in Related Links.-   For new HTML templates: The Sanitize option is enabled by default.\n-   For existing HTML document templates: The **Sanitize** option is inactive by default. Enabling sanitization on existing templates may remove some HTML content from the output. Review your templates before enabling this option to verify no critical information is lost.\n\n**Note:** Always enable the Sanitize option to secure your HTML templates.\n\nThe sanitization happens using the default HTML sanitizer. See [Exploring HTML sanitizer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/exploring.md-sanitizer.md) for more details.\n\nBy 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/t_ConfigureHTMLSanitizer.md).\n\n</td></tr><tr><td>\n\nTemplate language\n\n</td><td>\n\nLanguage 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:**\n\n-   Template language is a mandatory field. The default language is none.\n-   Translation feature is available only when language plugins are installed on the instance.\n\n\n</td></tr><tr><td>\n\nSelect variables\n\n</td><td>\n\nList 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.\n\nValid date offset variables are:-   + \\(plus\\)\n-   - \\(minus\\)\n-   d \\(days\\)\n-   w \\(weeks\\)\n-   m \\(months\\)\n Examples:\n\n-   Offer letter \\(five days after the stated date\\): Your offer is valid until $\\{Date +5d\\}.\n-   Benefits for terminated employee \\(two weeks from termination date\\): Your benefits end effective $\\{subject\\_person.hr\\_profile.employment\\_end\\_date +2w\\}.\n **Note:** Only variables that you have access appear.\n\n</td></tr><tr><td>\n\nSigning type\n\n</td><td>\n\nOption 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.\n\n</td></tr><tr><td colspan=\"2\">\n\n**Header**\n\n</td></tr><tr><td>\n\nHeader image\n\n</td><td>\n\nImage 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.\n\n</td></tr><tr><td>\n\nHeader image position\n\n</td><td>\n\nPosition where you want the header image to appear : left, right, or center.\n\n</td></tr><tr><td>\n\nHeader image height\n\n</td><td>\n\nHeight of the image in the header. **Important:**\n\n-   The height and width of the image is scaled proportionally based on the value that you specify.\n-   Ensure that the height of the image is lesser than the value specified in the **Page size** field, otherwise, the image is cropped.\n\n\n</td></tr><tr><td colspan=\"2\">\n\n**Footer**\n\n</td></tr><tr><td>\n\nFooter image\n\n</td><td>\n\nImage to be displayed in the footer.**Note:** Supported file types are: JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, and JBIG2.\n\n</td></tr><tr><td>\n\nFooter image height\n\n</td><td>\n\nHeight of the image in the footer. **Important:**\n\n-   The height and width of the image is scaled proportionally based on the value that you specify.\n-   Ensure that the height of the image is lesser than the value specified in the **Page size** field, else, the image is cropped.\n\n\n</td></tr><tr><td>\n\nFooter image position\n\n</td><td>\n\nPosition where you want the footer image to appear: left, right, or center.\n\n</td></tr><tr><td>\n\nFooter text\n\n</td><td>\n\nText to be displayed in the footer. For example, you can add proprietary and confidential statements.\n\n</td></tr><tr><td>\n\nFooter text position\n\n</td><td>\n\nPosition where you want the footer image to appear: left, right, or center.\n\n</td></tr><tr><td>\n\nVertical alignment\n\n</td><td>\n\nVertical alignment of the footer text with the footer image.\n\n</td></tr><tr><td colspan=\"2\">\n\n**Page**\n\n</td></tr><tr><td>\n\nPage size\n\n</td><td>\n\nSize of the page that can be selected from the list such as Letter, A4, or Legal.\n\n</td></tr><tr><td>\n\nCustom font\n\n</td><td>\n\nCustom 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.\n\n</td></tr><tr><td>\n\nTop/Bottom margin\n\n</td><td>\n\nSpace 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.\n\n</td></tr><tr><td>\n\nLeft/Right margin\n\n</td><td>\n\nSpace 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.\n\n</td></tr></tbody>\n</table>5.  Place the mouse in the desired location in the body of the template and select the **Insert Date** button to insert date variables.\n\n    You can use the button multiple times to add different types of dates based on the variables you choose.\n\n6.  Select **Add blocks**.\n\n    1.  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**.\n    2.  To add a new document block to the template, click **Create New Block**. For more information, see [Create document blocks in Document Templates](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/hr-service-delivery/create-doc-blc.md).\n7.  To automatically generate Table of Contents \\(TOC\\) and page numbers in the document that is generated from an HTML template, perform the following steps:\n\n    1.  In the **Table of Contents** field, select the TOC configuration that you want to apply on the HTML template.\n    2.  In the **Page number** field, select the page number configuration that you want to apply on the HTML template.\n    3.  Select **Insert Table of Contents** and insert the Table of Contents macro in the required position in the body of the HTML template.\n\n        **Note:** The Table of Contents macro will not be displayed if the TOC configuration is not selected in the **Table of Contents** field.\n\n8.  To translate content in templates using Localization Framework, select **Translate**.\n\n    For more information, see [Use Localization Framework for Document Templates](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/hr-service-delivery/doc-lzt-fm.md).\n\n9.  To save your document and remain on the **HTML Document Template** form, click **Save**.\n\n10. To save and return to the All Document Templates list, select **Submit**.\n\n\n"}}