Add/Edit Mail Template


On this screen, you can enter or edit the details of a particular mail template. 

Mail Template Definition

In this section, enter the following details about the mail template, including:

·         Template Name – the name of the mail template

·         From – the full email address of the sender, for example, “myname@domain.com”

·         Subject – the subject of the email, including template parameters

·         Email Message Type – choose whether or not the email will be displayed using HTML or plain text

·         Email Body – the body of the email message.  To show actual alerts, you will need to add several template parameters, described in the next section

·         SMS Body – the body of the SMS message used for users who have requested SMS text message notifications.  You can also use template parameters in this field.

Save/Cancel

To save your changes, click “Save” after entering the details above.  Or, to discard your changes, press “Cancel”. 

Diagnostics

To test the mail template, you can enter either an email address and press the “Send Email” button.  OptiTune will save the template, and fill it in with some sample events, and send the completed email message to the email address provided.  To test the SMS message, enter an SMS mobile phone number, select the mobile phone carrier, and press the “Send SMS” button.  OptiTune will again fill in the SMS Body template, and send the text message to the phone number provided.

Mail Template Parameters

In the Subject, Email Body, and SMS Body fields, you can enter “Mail Template Parameters”, which will be filled in before the email message or SMS message is sent to a recipient.  Below is a listing of all available template parameters.  Note that template parameters are enclosed in ‘$’ characters, for example, $myparam$.  To show only the $ character in an email message, you will need to enter $$ instead of a single $ character.

Parameter Name

Description

ToFirstName

The first name of the intended recipient, e.g. "John"

ToLastName

The last name of the intended recipient, e.g. "Smith"

ToFullName

The full name of the intended recipient, e.g. "John Smith"

ToEmailAddress

The email address of the intended recipient, e.g. "jsmith@gmail.com"

ToSMSNumber

The SMS number of the intended recipient, e.g. "555 555-5555"

OrganizationName

The name of the organization

OptiTuneBaseUrl

The base url for Optitune, without a trailing slash, e.g. "https://manage.opti-tune.com"

NumAlerts

The total number of alerts described in the alert email

AlertsShortSummary

A short summary of the alerts, suitable for an email subject, e.g. "2 critical, 1 warning"

AlertsHeaderImage

A header image web address which can be shown at the beginning of an alert email

ForEachAlertBegin

When this special template parameter is encountered, all text up to the next “ForEachAlertEnd” mail template parameter will be repeated and expanded for each alert.  This allows you to provide a simple template for how to display each alert.  See the example of ForEachAlertBegin/End below

ForEachAlertEnd

This special template parameter is not expanded, but indicates the end of an alert sequence.  See ForEachAlertBegin above.

AlertSeverityIcon

A URL to an image file for an alert’s severity icon.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertSeverity

An individual alert’s severity. 

This parameter can only occur within a ForEachAlertBegin/End section.

AlertName

An individual alert’s name.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertDescription

An individual alert’s description.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertCategories

An individual alert’s list of categories, separated by commas.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertComputerOrGroupIcon

A URL to an image file for a computer or group icon.  If the alert is for a computer, it will reference a computer icon, otherwise it will reference a group icon.  If the alert is specific to an entire organization, it will be empty.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertComputerOrGroup

A text label indicating if the alert is for a computer or group.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertComputerOrGroupName

The name of the computer or group that an individual alert pertains to.

This parameter can only occur within a ForEachAlertBegin/End section.

AlertDateTimeLong

The date and time that the alert occurred, in a long format.  If the email is being sent to an OptiTune user account, the user account’s time zone will be taken into account in generating this value.  Otherwise, the OptiTune server’s time zone will be used, typically Pacific Standard Time (PST).

 

This parameter can only occur within a ForEachAlertBegin/End section.

AlertDateTimeShort

Similar to AlertDateTimeLong, except the date and time are in the shorter format, e.g. 11/27/2014 12:03:01 AM

FirstAlertSeverityIcon

The value of AlertSeverityIcon for the first alert.

FirstAlertSeverity

The value of AlertSeverity for the first alert.

FirstAlertName

The value of AlertName for the first alert.

FirstAlertDescription

The value of AlertDescription for the first alert.

FirstAlertCategories

The value of AlertCategories for the first alert.

FirstAlertComputerOrGroupIcon

The value of AlertComputerOrGroupIcon for the first alert.

FirstAlertComputerOrGroup

The value of AlertComputerOrGroup for the first alert.

FirstAlertComputerOrGroupName

The value of AlertComputerOrGroupName for the first alert.

FirstAlertDateTimeLong

The value of AlertDateTimeLong for the first alert.

FirstAlertDateTimeShort

The value of AlertDateTimeShort for the first alert.

 

ForEachAlertBegin/ForEachAlertEnd

Since there may be one or more alert instances described in an alert email, we need a way to describe how to format a sequence of one or more alerts in the mail template.  This is where the special variables $ForEachAlertBegin$ and $ForEachAlertEnd$ come into play.

When expanding a mail template to send a message to a user, when the $ForEachAlertBegin$ parameter is encountered, all text up to the next $ForEachAlertEnd$ parameter is repeated and expanded for each alert.  This allows you to basically expand a list of alerts into displayable text.

In the example below, we will expand the list of alerts into rows of an HTML table (one alert per row).  Inside the <tbody> HTML tag, you will see the $ForEachAlertBegin$ parameter, followed by several $Alert…$ parameters, and finally ending with the $ForEachAlertEnd$.  The text between the $ForEachAlertBegin$ and $ForEachAlertEnd$ parameters will be repeated and expanded for each alert instance, filling in the parameters in green with each alert’s information.

    <tbody>   

        $ForEachAlertBegin$

        <tr>

            <td><img src="$AlertSeverityIcon$" alt="Alert Severity" /></td>

            <td>$AlertSeverity$</td>

            <td>$AlertName$</td>

            <td>$AlertDescription$</td>

            <td>$AlertDetails$</td>

            <td>$AlertCategories$</td>

            <td><img src="$AlertComputerOrGroupIcon$" alt="Computer or Group" /></td>

            <td>$AlertComputerOrGroupName$</td>

            <td>$AlertDateTimeShort$</td>

        </tr>

        $ForEachAlertEnd$

    </tbody>

 

Note that if you only want to show the first alert’s information, there are several $FirstAlert….$ variables which can be used to accomplish this (see the table above), and these variables are not placed inside a $ForEachAlertBegin/End$ section.