Sending email notifications

You can use the email notification service to send automatic email notifications to notify you about the completion status of Baselines that you run.

Before you begin

Before you can send email notifications, you must set up and configure the notification service.

About this task

After you have installed and configured the notification service, you can send email notifications to notify you about the completion status of Baselines.

Complete the following steps to send email notifications.

Procedure

  1. To use the notification service, add a modified copy of Task 2245 Sample Task: Send an Email Notification as a component in a Baseline at the point at which you want the notification to be sent. For example, if you want an email notification to be sent when the Baseline has completed, add the Task as the last component in the Baseline. Copy and modify the Task as follows:
    • Copy Task 2245 Sample Task: Send an Email Notification using Static Action Script Content.
    • Modify the copy of the Task by changing the details in the action script to include your specific settings for the following keys. The keys included in the following example represent the minimum required keys to send a notification:
      // NOTIFICATION_START 
      // to: "< your comma separated list of recepient email addresses goes here >"
      // from: "< your single email address that will be shown as the sender of the email goes here >" 
      // subject: "< your email title goes here >" 
      // body: "< your main email detail content goes here >" 
      // NOTIFICATION_END
      The complete list of keys are listed in the following table.
      Table 1. Notification keys
      Key Description
      to The email addresses to whom the notification is be sent. The valid values are a comma (,) separated list of valid email addresses. This is a required key.
      from

      The email address that is displayed as the sender of the notification email. The email address does not have to exist, but the value that you specify must be in the format of a valid email address. This is a required key.

      subject

      The notification summary that appears as the subject of the email. Any text is a valid entry for this key. The text that you enter can include tokens that are replaced at run-time. This is a required field.

      body

      The main notification text content for the email. You can enter any text for this key, including tokens that are replaced at run-time. This is a required field.

      failure-trigger

      This defines the number of failures that cause the notification to be sent. When this key is specified, the notification is sent when the specified number of failures occurs. When this key is omitted, the notification is sent when it completes. Enter a whole number greater than zero. This is an optional key.

      scope

      Determines which action is examined for result statuses when determining if an action failed or completed successfully. When this key is omitted, the results of the action containing these notification comments are examined. The valid value is parent, which means the results of the parent Baseline are examined instead of the action containing the notification comments. This is an optional key.

    • Save the modified copy of the Task.
    • Add your modified copy to the Baseline for which you want to send the email notification.
    Review the Task description for complete information about how to modify the Task and include in a Baseline. Examples are included in the Example section below.
  2. Run the Baseline. When the Baseline completes, an email notification is sent to the email addresses that you specified.

Example

The following examples show how you can use the keys:
If you add the Task with the following notification comments as a component in a baseline, it sends an email when this Task (component) completes (for example, this may be useful if added to the middle of a baseline):
// NOTIFICATION_START 
// to: "me@me.com, you@you.com"
// from: "noreply@bigfixteam.mycompany.com" 
// subject: "Basline component '{actionName}' has completed successfully" 
// body: "Baseline is 50% complete now" 
// NOTIFICATION_END
When a Task consisting of the following notification comments is added as a component in a Baseline, it sends an email when that overall Baseline completes:
// NOTIFICATION_START 
// to: "me@me.com, you@you.com"
// from: "noreply@bigfixteam.mycompany.com" 
// subject: "Basline '{actionName}' with ID {actionID} has completed successfully" 
// body: "The Baseline is complete!" 
// scope: "parent"
// NOTIFICATION_END

You can add the previous two examples only to baselines that are statically targeted. Baselines targeted by group, property or name list do not enable a notification to be sent.

You can specify the following example in Baselines targeted statically or dynamically:
// NOTIFICATION_START 
// to: "me@me.com, you@you.com"
// from: "noreply@bigfixteam.mycompany.com" 
// subject: "Basline '{actionName}' with ID {actionID} has failed on 5 or more computers" 
// body: "Review the results of Baseline '{actionName}' (ID: {actionID})" 
// failure-trigger: "5"
// scope: "parent"
// NOTIFICATION_END