Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Customizing HTML email notifications
This chapter describes the most typical scenarios of customizing HTML email notifications. Instead of using the out-of-box set of email notifications and templates, your organization is likely to have its own email templates and include its own fields in email messages. For example, a company may include its company logo and follow its own color schemes in email messages.
In most scenarios, you only need to make some minor changes to an out-of-box HTML template, such as changing the formatting of the message body and including some additional fields in the email message. Therefore, you can use the out-of-box HTML template as a basis and create your own HTML templates by copying from that out-of-box template.
Create your own HTML templates
To create a custom HTML template, follow these steps:
- Click Tailoring > Notifications > HTML Templates.
-
Search for and select an existing HTML template as the base of the new template.
Example: SM Add
-
On the General tab, specify a name for the new template in the Name field.
-
Change the Mail Title field if necessary.
-
In the Language field, select a language for the template.
-
Describe the template in the Comment text box.
-
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.
-
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
-
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}
. -
To generate a preview using the Module and Test Record fields that you specified in step 7, click the Preview tab.
-
Click Add to create the new template.
Localize a template
To create a language version of an HTML template, follow these steps:
-
Click Tailoring > Notifications > HTML Templates.
-
Use search or advanced search to find the template that you want to localize.
-
On the General tab, select a language in the Language field for the localized template.
-
Keep the name in the Name field as is, because HTML template records with the same name are considered language versions of one template.
-
In the Mail Title field, replace the original text with the appropriate translation and make sure all the variables are in the correct positions.
-
On the HTML Source tab, replace the original text with the appropriate translation.
-
Click the Preview tab to verify that your localized version works as expected.
-
Click Add to create the localized template.
Link an HTML template to a notification
To link an HTML template to a notification, follow these steps:
-
Click Tailoring > Notifications > Notifications.
-
Search for the notification record to which you want to link the HTML template.
-
On the Message tab, locate the message with an Msg Class of HTMLTemplate and an id Msg No. of 1.
-
In the Arguments field, replace the second argument of the jscall function with the name of the template that you want to use for this notification.
-
On the Email/Mail Subject Line tab, locate the message with an Msg Class of HTMLTemplate and an id Msg No. of 1.
-
In the Arguments field, replace the second argument of the jscall function with the name of the template that you want to use for this notification.
-
Click Save to save the changes.
Add commonly used elements in templates
This section describes how to add certain elements that you are likely to include in your email message.
Images
To post images in the message, you must store the images in a location that your email recipients can access and add image tags referencing the corresponding URLs.
Web URL
It is a common practice to include a Web URL in the email message pointing to the corresponding record so that the recipient can follow the link to view the record in a Service Manager web client. You can reference the web_url
variable that is defined in the expressions of the out-of-box templates.
You can keep one of the following statements and comment out the other one, depending on whether the email message is sent to an ESS user or a regular Web-tier user.
For ESS users:
var web_url = lib.urlCreator.getURLFromQuery(file_name,record_query,record_title);
For regular Web-tier users:
var web_url = lib.urlCreator.getESSURLFromQuery(file_name,record_query,record_title);