Content Object

This object represents the content to be delivered to a Device.

Note that content objects cannot be used to pass information from the initial script into a presentation script as the content objects in presentation scripts are created specifically for each notification, and are not the same as the objects set for generic content. To pass information from the initial script into a presentation script, use the event, main, or notification script objects.

Creation Method: Created for static content delivery, and provided as a context object for a notification presentation script.

Reference Name: User-defined reference name for static content delivery; @content for a notification presentation script.

Scope: Script lifecycle.

Script Object Variables

For information about the variables used in this object, see the System Tokens page.

Formatting HTML Email Messages

You can edit the presentation scripts to include an HTML version of the email message content using the "htmlmessage" token. This token will be processed by the SMTP, MAPI and BES Device Engines along with the "message" token.

The following is a script sample of the token in use:

# Create the email content for a plain text message. This is required as

# all email clients support plain text content.

  $content.subject = "xMatters Message: " & $event.incident_id

  $content.message = $content.message & "An event occurred - \n"

  $content.message = $content.message & "Situation: " & $content.situation & "\n"

  $content.message = $content.message & "Device: " & $content.device & "\n"

  $content.message = $content.message & "Time of Incident: " & $userTime & "\n"

# You can also construct an HTML message. This is optional and will be

# displayed only if the email client supports HTML.

# Note: The maximum length of each string is 4000 characters. In order to

# create content that exceeds the 4000 character limit, the message must

# be split into smaller sections and added to the htmlmessage token.

  $content.htmlmessage = $content.htmlmessage & "An event occurred - \n"

  $content.htmlmessage::add("<b>Situation:</b> <i>" & $content.situation & "</i>\n")

  $content.htmlmessage::add("<b>Device:</b> <i>" & $content.device & "</i>\n")

  $content.htmlmessage::add("<b>Time of Incident:</b> <i>" & $userTime & "</i>\n")

The recipient’s mail client determines whether the HTML message or the plain text message will be displayed. For example, the Outlook email client will default to displaying HTML emails, but can be configured to only display plain text. A plain text version of the email must be created using the "message" token. This is required in case the email client does not support HTML content.

The HTML content can include forms that allow the user to submit responses back to xMatters. This functionality requires that the xMatters web server be configured with a custom JSP page to process the response.

Setting Notification Priority

A reserved system token (availability: xMatters version 4.0 patch 006) enables you to assign a value to the Device Engine Content that will pass the importance of the email message into the recipient's email client.

Email clients read the value of the "X-Priority" header within an email to determine the importance of a message. You can set the $content.priority variable to a text value, which maps to the X-Priority header as follows:

Value of $content.priority X-Priority Mapping
HIGHEST 1
HIGH 2
NORMAL 3
LOW 4
LOWEST 5
Any other value 3

Note that most email clients have only three levels of importance: High, Normal, and Low. Highest and Lowest will automatically map to High and Low, respectively.

Example

To set all email messages to "High" priority, modify the presentation script as follows (note the bolded line):

IF ($content.deviceclassification == "email")
  $content.subject = "xMatters Message: " & $event.incident_id
  $content.message = $content.message & "An event occurred."
  $content.priority = "HIGH"
        
ENDIF

Device Engine Content