Alert Event Receivers are class libraries you develop and publish in Workflow Studio to respond to one or more Alert Events. Each one is capable of listening for and responding to any number of subscribed events that occur in a given environment. One Alert Event Receiver is capable of performing more than one task per event and each event can be subscribed to by more than one Alert Event Receiver. You can create custom Alert Event Receivers to perform any desired action when a corresponding alert to which it is subscribed occurs. You create custom Alert Event Receivers by deriving them from the base AlertEventReceiver abstract class, overriding the OnProcessAlert() method with your specific implementation of the abstract class. 

In this topic, we demonstrate how to create a custom Alert Event Receiver that creates a log event and sends an email notification whenever users become locked out of their accounts. 

To create a custom Alert Event Receiver for locked out users

  1. In Workflow Studio, click the application icon to open the application menu and select Extensibility, then EmpowerID Alert Event Receiver.



  2. Name the event receiver and select the package under which to create it.



    This opens the C# Editor for the custom Alert Event Receiver. Notice that the class automatically derives from the base AlertEventReceiver class.



  3. From the OnProcessAlert() method, replace the TODO comment with code that does the following: 
  4. Below the OnProcessAlert() method, add code to create the method stub for the AddAuditLog() method and then in the method body add code to do the following:
  5. Below the AddAuditLog() method, add code to create the method stub for the SendLockedOutEmail() method and then in the method body add code to do the following:
  6. In the Properties grid, set the Alerts property to PersonLockedOut.