Add an email notification

  • Release version: Xanadu
  • Updated August 1, 2024
  • 5 minutes to read
  • Build notifications in App Engine Studio (AES) to create automated emails for events using templates or custom messages.

    Before you begin

    You can perform this task if you're either an administrator or a developer for the application. The required developer permission is All File Types. For more information on being a developer for an application, see Delegated development in App Engine Studio.

    Role required: admin or delegated_developer

    About this task

    Email notifications enable you to send emails to the selected users about activities in the system, such as updates to incidents or change requests.
    Note:
    You can't currently create any other types of automatic notifications, such as SMS messages.

    Creating an email notification involves specifying when to send it, who receives it, and what it contains.

    If your administrator has created an email template in the ServiceNow AI Platform, you can use it as is or override its content. For more information on email templates, see Email Templates. Also check with your administrator to see if they are using email layouts to control the header, body, and footer. For more information on email layouts, see Email layouts.

    Procedure

    1. Navigate to All > App Engine > App Engine Studio.
    2. From the My Apps page, open your application.
    3. In your application, in the Logic and Automation section, select Add.
    4. Select the card for Email.
      Figure 1. Add email notification
      Select to add an email notification
    5. On the form, fill in the fields for the basic settings.
      Table 1. Add notification form basic settings
      Field Description
      Name Name of the email notification. Descriptive names help identify the purpose of the email notification. For example, Incident Opened & Unassigned.
      Short description A brief explanation of the purpose of the notification.
    6. On the Notification trigger settings section of the form, fill in the fields.
      Table 2. Add notification form Notification trigger settings
      Field Description
      Send email notification Situation where a notification is sent, such as after something happens or when a table is modified. Choices are as follows:
      • When a record is created or updated
      • Only when a record is created
      • Only when a record is updated
      • When triggered via Flow Action
      • When event is fired

      This field is automatically set to When a record is created or updated.

      After you create an email notification with a Flow Action as the trigger, you specify the notification when creating a flow in Workflow Studio. For more information, see Notification step.

      Table The database table that hosts the records to link the notification trigger to. For example, the Incident [incident] table.
      If you set the Send email notification field to one of the following values, the table is required:
      • When a record is created or updated
      • Only when a record is created
      • Only when a record is updated
      You can select from two sections: Tables that are already available in your app, and all tables outside the app scope.
      Event name Event that triggers the notification. This field appears only when When event is fired is selected from the Send email notification field.

      If the same trigger generates multiple notifications, the system only sends one notification. The system considers all other notifications, even if they have a different subject and body, as duplicates. The Ignore Duplicates business rule controls this functionality.

    7. Make the trigger conditional by using the condition builder.

      Define the condition sets and values that must be met for the notification trigger. For more information, see Condition builder.

      Note:
      If you specify that the notification trigger is a Flow Action, the condition builder isn't available.
    8. In the Recipients section of the form, specify who receives the notification.
      You can:
      • Search for users or groups.
      • Define dynamic recipients by selecting Add, which requires you to specify a table in the notification trigger details.
      Table 3. Add notification form Recipients settings
      Field Description
      Users and groups from table fields Dynamic users and groups who receive the email based on the table. For example, if a notification uses the Incident [incident] table, you can select the Opened by field to send the notification to users or groups who opened the incident. For some fields, you can also select values contained by a reference field, such as Opened by > Manager.
      Select the Add button to search for dynamic users and groups based on fields from the specified table.
      Note:
      If you don't specify a table, the Add button isn't available.
      People and groups Static addresses for users and groups who receive the email notification. You can also search for users and groups.

      Specify recipient by table field

    9. In the Email content section of the form, select a template or write original content.
      Table 4. Add notification form Email content settings
      Field Description
      Email template Predefined email template that you can use to apply existing content, which you can override. You can select only templates that have the following:
      • The same table as the notification
      • No specified table

      If you use a template and don't override it, then when your administrator updates the template, the content of your email notification is also automatically updated.

      Override template Option to override the contents of the selected email template.

      If you use an email template, any images from the template still belong to the template regardless of whether you override it. Images in the notification are automatically updated when administrators update the template.

      If you override an email template and then change the selected template, the system removes the overrides and replaces them with content from the new template.

      Subject Subject line for the email.

      To make the subject dynamic, use the Email variables field next to the Email message to generate variable syntax in the message body. You cam then copy and paste the variable syntax in the subject line.

      If empty, the system uses the Subject value from the email template. If you enter a value in this field, it overrides the template.

      Email message Content of the email notification message, which can include variables.

      You can format the contents of the email message using the rich text editor icons.

      If empty, the system uses the Message value from the email template. If you enter a value in this field, it overrides the template value.

      Add variables Dynamic variables, or values, derived from fields in the specified table.
      Note:
      You must specify a table for the Add variables button to appear.

      Select variables in the Email variables field and use the arrow to move them into the Email message.

      Use variables to include values from a record in the table, such as an incident short description or comments and work notes. Variables are available fields from the specified table.

    10. Select Create
      The notification is saved, and you can preview it.
    11. View how the email notification appears by selecting Preview.

      Check the preview that appears. To see how a notification renders, select the search icon in the preview and select the record you want to preview.

      Search to preview the email notification for a specific record

    Result

    When you create a notification in AES, the notification is saved only to the application that you’re currently building.