Using action hooks to send e-mail

You can use an action notification hook to send e-mail messages when a user completes a specific action. In your hook code, you use the HCL Compass API to create the message and send it.

About this task

The predefined schemas include the Send_Email_Notif base action in all enabled records. This action calls RSEM_ProcessEmailRules, and the action type is used for all actions.

If you change the names of record types or actions in the schema, you must update your action hook to reflect the new names.

Procedure

To create an action notification hook:
  1. Start the Designer.
  2. Log on to the Designer as a user with the schema designer or super user privilege.
  3. In the Schema Repository Explorer, expand the Record Types or Record Types - Stateless folder until you see the record type whose action you want to modify.
  4. To open the record type editor, double-click the record type.
  5. To view the Record Actions grid, click the Actions tab.
  6. In the Record Actions grid, click the Notification column of the action that you want to add the notification hook to; then click the Arrow icon and click SCRIPTS > BASIC or SCRIPTS > PERL.
    If Instant Editing Mode is enabled, the Script editor opens. If Instant Editing Mode is disabled, double-click the cell to start the Script editor.

    VBScript and Perl have their own script editors. The Designer indicates the current editor in the title bar of the Designer window. Verify that you are using the correct editor before adding or editing your code.

  7. To compile your code and verify that there are no syntax errors, add your hook code, and click Hooks > Compile.

Results

For more information, see Action hooks and the Action notification hook example in the HCL Compass API reference pages.