Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.

Notification example: schedule reminder emails to users

Log in to subscribe to topics and get notified when content changes.

Notification example: schedule reminder emails to users

Remind users when they need to view or update records.

Before you begin

Role required: admin

Set up your email as a test email address. Navigate to System Properties > Email Properties, and then enter your email address under Send all email to this test email address.

About this task

This exercise has you create the following:
  • A custom date/time field on the Incident [incident] form
  • A business rule to schedule an event based on the custom field
  • An email notification to react to that event

Procedure

  1. Create a custom date/time field on the Incident form labeled Reminder.
    1. Navigate to Incident > Open, and then open any record.
    2. From the form context menu, navigate to Configure > Form Layout.
    3. Under Create new field, enter the following values:
      Field Value
      Name Reminder
      Type Date/Time
    4. Click Add, and then click Save.
  2. Create a business rule that schedules an event when the Reminder field is updated.
    1. Navigate to System Definition > Business Rules, and then click New.
    2. On the form, enter the following values:
      Field Value
      Name Incident Reminder
      Table Incident [incident]
      Active Selected
      Advanced Selected
      When after
      Insert Selected
      Update Selected
      Filter Conditions [Reminder] [changes]
      Script
      gs.eventQueueScheduled("incident.reminder",current,gs.getUserID(),gs.getUserName(),current.u_reminder);
      Note: The gs.eventQueueScheduled() function is similar to the standard event creation function but can pass a parameter to specify when the event is triggered. In this case, the event is triggered at the date and time specified in the Reminder field.
    3. Click Submit.
  3. Register the reminder event.
    1. Navigate to System Policy > Events > Registry, and then click New.
    2. On the form, enter the following values:
      Field Value
      Event name incident.reminder
      Table Incident [table]
      Fired by Business rule
      Description Send a reminder
  4. Test that the business rule creates the event.
    1. Navigate to Incident > Open, and then open any incident record.
    2. In the incident, select a date-time value that is one minute from now in the Reminder field, and then click Update.
    3. Wait one minute for the event conditions to be met.
    4. Navigate to System Policy > Events > Event log and look for an event with the name incident.reminder.
  5. Create an email notification record that reacts to the incident.reminder event.
    1. Navigate to System Notification > Email > Notifications, and then click New.
    2. On the form, enter the following values:
      Field Value
      Name Incident Reminder
      Table Incident [incident]
      Active Selected
      Category Incident Alert
      Send when Event is fired
      Event name incident.reminder
      Users/Groups in fields Assigned to
      Subject
      Reminder for ${number} - ${short_description}
    3. In the Message HTML field, add a message to send to whomever needs to view or update the incident record.
    4. From the form context menu, click Save.
  6. Preview the email notification to ensure it includes all the needed information.
    1. On the notifications form, click Preview Notification.
    2. Note that the email includes the following information:
      • The incident number in the Subject line
      • A short description of the incident in the Subject line
  7. Test that the reminder notification sends at the scheduled time.
    1. Navigate to Incident > Open, and open any incident.
    2. In the Reminder field, set the reminder for a few minutes from now.
    3. Click Update.
    You should receive a reminder email in a few minutes.
Feedback