Create your own HTML templates

To create a custom HTML template, follow these steps:

  1. Click Tailoring > Notifications > HTML Templates.
  2. Search for and select an existing HTML template as the base of the new template.

    Example: SM Add

  3. On the General tab, specify a name for the new template in the Name field.

  4. Change the Mail Title field if necessary.

  5. In the Language field, select a language for the template.

  6. Describe the template in the Comment text box.

  7. The Module and Test Record fields combined determine which record is passed in for preview. Select a module in the Module field and specify the id of the record in the Test Record field.

    Note The module name is designed to be a general name, it may include multiple tables or refer to nonexistent table. Therefore, not all previews are supported currently.

  8. In the text box on the Expressions tab, edit the JavaScript code that evaluates the variables that you include in the email message.

    Note To post certain field values of the record that is passed in, you can add these fields directly in the HTML Source, such as $RECORD.incident_id. However, if you want to add variables computed based on record fields, you must evaluate these variables using JavaScript code on the Expressions tab and then post the variables in the HTML Source.

    Only the following simple data types are supported:

    • String
    • Date/Time
    • Logical
    • Number
  9. The HTML Source tab displays an HTML editor where you can design the message body of your HTML template. You can click Source to toggle between the normal view and the source code view. To reference a variable or expression in the message, enclose your variable or expression in braces, such as {$RECORD.title}.

  10. To generate a preview using the Module and Test Record fields that you specified in step 7, click the Preview tab.

  11. Click Add to create the new template.