Increasing length of email subjects

This article applies to the Premises (i.e., 5.1) version of xMatters only.

If you are using the generic scripts in the Integration Agent, you may encounter a 50-character limit on the length of the Subject field for email notifications. Any email subjects longer than 50 characters will be truncated.

You can increase this limit by editing the notification content scripts using the xMatters Developer IDE. 

NOTE: According to rfc2822, email servers are not required to support subject lines longer than 78 characters. If you modify the scripts to allow subjects longer than 78 characters, your notifications may cause delivery issues with some email servers:

To enable longer subject lines for email notifications:

  1. Open the BUSINESS PROCESS > CONTENT script. 
  2. Locate the following block of code:
  # Specify subject line content.  If the subject already exists in the notifcation object then use that, otherwise create a new subject.
  IF ( EXISTS( $notification.subject ) )
    $subject = $notification.subject
  ELSE-IF ( EXISTS( $event.subject ) )
    IF ($subscription)
      $subscriptionString = "Subscription"
      $shortSubscriptionString = "xM SUB: "

    $subject = $event.subject
    $msg = $event.message
    $strLength = $msg::length()
    IF($strLength < 50)
      $summary = $msg
      $shortMsg = $msg::substring(0,49)
      $shortMsg = $shortMsg & "..."
      $summary = $shortMsg
    IF ($subscription)
      $subscriptionString = "Subscription"
      $shortSubscriptionString = "xM SUB: "

    $subject = $summary
  1. Modify the IF($strLength < 50) and $shortMsg = $msg::substring(0,49) to the length you want.
  2. The IF statement must be one digit higher than the $shortMsg assignment.



xMatters internal reference: DTN-4767

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk