Alert message configuration with XSL
You can customize the formatting for your alert messages by modifying one of the default XSL style sheets, or creating your own XSL template. The default XSL style sheets are divided into different sections for each type of alert messages. Discover administrators who are comfortable with XSL can modify the text and formatting of each type of alert.
Before you begin
About this task
- If the Discover server cannot access the customized template that you specified, the default alert template is used and a message is logged in the log file.
- The alert service identifies a template by the file name. To avoid overwriting a template, the administrators can follow a specific naming scheme for your templates.
- The template XSLs must have the following tags to generate the
subject and body of the email:The following section lets the server select the email body or email subject from template:
<xsl:template match="AlertServiceAlertMessage"> <xsl:choose> <xsl:when test="@MessageType[.='Default']"> <xsl:call-template name="MailBodyDefault" /> </xsl:when> <xsl:when test="@MessageType[.='SubjectDefault']"> <xsl:call-template name="MailSubjectDefault" /> </xsl:when> </xsl:choose> </xsl:template>
The following sections defines the email body:<xsl:template name="MailBodyDefault"> <HTML> <HEAD> ... ... ... </BODY> </HTML> </xsl:template>
The following sections defines the email subject:<xsl:template name="MailSubjectDefault"> Discover Event Test Email <xsl:value-of select="ThresholdCategory" /> <xsl:value-of select="EventTitle" /> </xsl:template>
Procedure
Complete the following steps to use your customized template
for alert messages:
- On the computer where you have saved the customized template, go to the Discover Portal and open the Edit Alert window.
- Click the Notification tab.
In the Current template field, you can see the template that is currently used for your alert messages.
- Select the Use template check box, and browse to the customized template.
- Select the Overwrite Existing File check
box to update the templates that are already being used.If you do not select the Overwrite Existing File check box, you can see the following error message:
Error saving Alert (draft)! File Already Exists:<file path to template>
- Click Save draft to save your changes.