Notification Tags

Notification tags can only be used in Notification e-mail templates.

Note: All notification tags can be used in Notification e-mail templates for Service Level Agreements (SLAs); however, dynamic SLA-specific information cannot be returned.

Several Notification template tags are conditional tags. The condition for each of these tags is placed between parentheses after the $IF statement. The conditional tags can be used with $ELSE() and $ENDIF() tags to tailor the content of the e-mail message depending on whether the condition is true or false.

$ATTACHMENT()

  • Description

    Adds all files attached to an item to the e-mail notification.

  • Usage

    Attachments must be stored in the SBM database and not on the file system. (This setting is applied in SBM System Administrator.)

    Files are not attached to messages if their combined size exceeds the limit specified in SBM Configurator.

    Attachments are only included with a notification if users have privileges to view those attachments in the associated item.
    Note: Use the $FILEATTACHMENTLINKS() tag to include links to attachments in the notification rather than actual files.
  • Parameters

    None.

$ALLRECIPIENTS()

  • Description

    Adds a comma-separated list of subscribers to the e-mail notification.

  • Usage
    Use this tag to include a list of all the current users that are subscribed to the notification.
    Note: To avoid sending a potential large list of subscribers, perform the following steps on the SBM server that hosts the Notification Server:
    1. Edit the config.properties file located here:
      installationDirectory\Serena\SBM\Common\jboss405\server\default\deploy\
      notificationsrv.war\WEB-INF\classes
    2. Search for the event.allrecipients.maxsize setting.
    3. Enter the maximum number of subscribers that should appear. For example, to display only three subscribers, change the setting as follows:
      event.allrecipients.maxsize=3
      In this example, the list in the notification shows the first three subscribers, followed by ellipses:
      Hans Tester (hans@serena.com), Chad Support (chad@serena.com), 
      Administrator (admin@serena.com),...
    4. Save your changes. The new maximum size will take effect after the next JBoss restart.
  • Parameters

    None.

  • Sample
    $ALLRECIPIENTS()
    Result:
    Hans Tester (hans@serena.com), Chad Support (chad@serena.com), 
    Administrator (admin@serena.com), Bill Admin (bill@serena.com)

$CHANGEACTION()

  • Descripton

    Returns the action and user that caused the notification to be generated, along with the date and time the action occurred.

  • Usage

    Change action examples include state changes, item updates, and attachment additions. Date and time action occurred is also returned.

    Change actions are only sent to users who have privileges to view the change history for the item on which the notification is based. For delayed escalations, changes may not be available.

  • Parameters

    None.

  • Sample
    $BEGINSUBJECT()$NOTIFICATION() - $ITEMNUMBER()$CHANGEACTION()$ENDSUBJECT()

    Result:

    image

$CHANGES()

  • Description

    Returns the change history entries for an item.

  • Usage

    Change history records are only sent to users who have privileges to view the change history for the item on which the notification is based. For delayed escalations, changes may not be available.

  • Parameters

    Insert the number of change history entries to return between the parentheses. If you do not specify a number in the parameter, all transitions and changed data are returned.

  • Sample
    $CHANGES()

    Result for HTML template:

    image

You can optionally apply a cascading style sheet (CSS) to the $CHANGES() tag. For best results, place the CSS tags before the $CHANGES() tag, and place the $CHANGES() tag at the bottom of the template. For example:
<style media="screen" type="text/css">
table.serena_ns_changes_table {border: thin solid black;background-color:#0000ff;}
tr.serena_ns_changes_tr {background-color:#ff0000;}
td.serena_ns_changes_td_field {background-color:#777777;}
td.serena_ns_changes_td {background-color:#ffffff;}
</style>
$CHANGES()
</body>
</html>

Result:

image

$EMAILRESPONSE()

  • Description

    Returns links that correspond to notification responses, as discussed in E-mail Responses.

  • Usage

    Add a tag for each response you have configured for a given notification, using an href attribute. Each response tag that you add will appear in the notification message.

  • Parameters
    For HTML e-mail templates, insert the name of the response, followed by external or internal. These values correspond to the Web server links that you configure for the Notification Server in SBM Configurator.
    Important: You must enter the same response name that you specified in the E-mail Responses tab. For example, if you entered Approve as an alias for the "Manager Approval" transition, you must enter Approve in the $EMAILRESPONSE() parameter. See the example below.
  • Sample
    $BEGINSUBJECT()$NOTIFICATION() - $ITEMNUMBER() $TTID()$ENDSUBJECT()
    <meta http-equiv="Content-Type" content="text/html; charset=$GETSETTINGSSTR(CharSet,UTF-8)">
    <title>$NOTIFICATION() - $ITEMNUMBER() $TTID()</title>
    <style type="text/css">
    a.attachlink:link { color: #0000FF }
    a.attachlink:visited { color: #0000FF }
    a.attachlink:hover { color: #006600 } 
    </style>
    $IF(AUXTABLE)$ELSE()$ENDIF()
    <table>
    <tbody>
    <tr>
    <td><b>$STRING(IDS_EMAIL_DISPLAYVALUE):</b></td>
    <td>$ITEMNUMBER()</td>
    </tr>
    <tr>
    <td><b>$SYSFIELDNAME(TS_SYSFLD_TEXT_DISPLAYID):</b></td>
    <td>$ITEMNUMBER()</td>
    </tr>
    <tr>
    <td><b>$SYSFIELDNAME(TS_SYSFLD_TITLE):</b></td>
    <td>$TITLE()</td></tr>
    </tbody>
    </table>
    <br>Dear $RECIPIENT(),<br><br><p align="left"> This ticket requires your approval.</p>
    <p align="left"> To approve, click <a href="$EMAILRESPONSE(Approve, external)" 
    style="background: #11356D; color: white; display: inline-block; width: auto; 
    text-align: center;text-decoration:none;border:10px solid #11356D;">Approve</a></p>
    <p align="left"> To reject, click <a href="$EMAILRESPONSE(Reject, external)" 
    style="background: #11356D; color: white; display: inline-block; width: auto; 
    text-align: center;text-decoration:none;border:10px solid #11356D;">Reject</a></p>
    <br>$IF(CANVIEW)$IF(VIEWLINK)
    <b>$STRING(IDS_EMAIL_TOVIEW) $ITEMTYPENAME():</b> $LINK( TRUE )$ENDIF()$ENDIF()<br>
    <br>$IF(CANVIEW)$FIELDS()$ENDIF()<br>
    <br>$FILEATTACHMENTLINKS()

    In this example, the response names Approve and Reject are used as aliases for their respective transitions. The second parameter (external or internal) configures the link for access outside or inside the firewall.

    Result:

    image

$FIELDS()

  • Description

    Returns fields selected on the Fields page for each notification, as discussed in E-mail Field Settings.

  • Usage

    Asterisks replace field values for users who do not have permission to view fields included in the notification. Fields in the Not Used fields section are not included in the e-mail notification.

  • Parameters

    For HTML e-mail templates, insert the number of display columns between the parentheses. If you do not specify the parameter, the default number of display columns is 2. This parameter is ignored for text-formatted e-mail messages.

  • Sample
    $IF(CANVIEW)
    $FIELDS()
    $ENDIF()

    Result for user who cannot view specific fields:

    image

$IF() Tags

Use with the following parameters and the $ELSE() and $ENDIF() conditional tags.
Note: All line breaks and spaces are left in the message during template processing. For statements to display as one line in the e-mail message, the conditional statement must not include any line breaks.

$ITEMNUMBER()

  • Description

    Returns the system-generated ID number.

  • Usage

    For primary items, returns the prefix, if any, and ID number of the item associated with the e-mail notification. For auxiliary items, returns the ID number if the auxiliary table contains the system Item ID field. If it does not, the table's display name is returned.

  • Parameters

    None.

  • Sample (Subject Line)
     $BEGINSUBJECT()$NOTIFICATION() - $ITEMNUMBER() $ENDSUBJECT()
            

    Result:

    image

$ITEMTYPENAME()

  • Description

    Returns the singular item name for the primary or auxiliary table.

  • Usage

    The singular item name is specified in SBM Composer and can be viewed in the General tab of the Edit Table property editor for the applicable table.

  • Parameters

    None.

  • Sample
    $STRING(IDS_EMAIL_TOVIEW) $ITEMTYPENAME(): $LINK( TRUE )
            

    Result:

    image

$MAILHEADERPARAM()

$NOTES()

$NOTIFICATION()

  • Description

    Returns the name of the notification.

  • Usage

    The notification name is available on the General page when you are adding or editing notifications and escalations.

  • Parameters

    None.

  • Sample
    $NOTIFICATION() - $ITEMNUMBER()
            

$PAUSESTATUS()

  • Description

    Returns whether the item is paused or unpaused.

  • Usage

    Use to indicate whether an item is paused or unpaused. If an item has been paused by Serena Demand Manager, the tag returns "Paused".

  • Parameters

    None.

  • Sample
    $PAUSESTATUS()

$RECIPIENT()

  • Description

    Returns the name of the notification recipient.

  • Usage

    The name specified in the Full Name box in the user's profile is used.

  • Parameters

    None.

  • Sample
    To $RECIPIENT():
            

    Result:

    image

$RECIPIENTEMAIL()

  • Description

    Returns the e-mail address of the notification recipient.

  • Usage

    All e-mail addresses specified for a user are returned. Mutiple e-mail addresses are separated by a semi-colon.

  • Parameters

    None.

  • Sample
    To $RECIPIENT() at $RECIPIENTEMAIL():
            

    Result:

    image

$REPEATCOUNTER()

  • Description

    Returns the current number of repeated notifications.

  • Usage

    Use this tag to display the number of times that the notification has been repeated.

  • Parameters

    None.

  • Sample
    Number of repeated notifications: $REPEATCOUNTER()

    Result:

    Number of repeated notifications: 5

$TITLE()

  • Description

    Returns the title of the item associated with the notification.

  • Usage

    Information provided in the system Title field is used.

  • Parameters

    None.

  • Sample
    $SYSFIELDNAME(TS_SYSFLD_TITLE): $TITLE()
            

    Result:

    image

$TRIGGEREDDATETIME()

  • Description

    Returns the date and time the notification rule became "true" for an item.

  • Usage

    Date and time are formatted for the locale set in each user's profile.

  • Parameters

    None.

  • Sample
    This notification was triggered at $TRIGGEREDDATETIME()

    Result:

    image

$TTID()

  • Description

    Returns the identifier ([ttid: table ID, record ID]) required by the E-mail Recorder feature, which attaches replies to the e-mail notification to the item to which it pertains.

  • Usage

    By default, the $TTID() tag is enclosed by the $BEGINSUBJECT() and $ENDSUBJECT() base template tags in the default.txt notification template. This tag must remain in this location for the E-mail Recorder to function properly. If the E-mail Recorder is not configured, this tag is ignored. For details on the E-mail Recorder, refer to the SBM Installation and Configuration Guide.

  • Parameters

    None.

  • Sample
    $BEGINSUBJECT()$NOTIFICATION() - $ITEMNUMBER() $TTID()$ENDSUBJECT()
            

    Result:

    image