com.ibm.openpages.api.trigger.oob

## Class SendEmailEventHandler

- java.lang.Object
- - com.ibm.openpages.api.trigger.AbstractEventHandler
  - - com.ibm.openpages.api.trigger.ext.DefaultEventHandler
    - - com.ibm.openpages.api.trigger.oob.SendEmailEventHandler

-     public class SendEmailEventHandler
      extends DefaultEventHandler

  This GRC trigger event handler sends email out to users specified in the fields of the Resource object.
  Usage: This event handler can be used for following events:
  create.object
  create.object.with.relations
  update.object
  This event handler can be executed in the PRE or POST position.
  Attributes:

  Attribute | Values | Description | Required | Default
  --- | --- | --- | --- | ---
  on.change.only | true false | Specify whether email should be sent out only when the user field has changed. | No | false
  notify.old.users | true false | Specify whether email should be sent out to the old user when the user has changed. | No | false
  from.address |  | An email address identify, where the email come from. | Yes |
  user.fields |  | A comma-separated list of field paths which have the user name in them. | Yes |
  email.subject.string.key |  | A key for the application text for the subject of the email. | Yes |
  email.subject.parameter.fields |  | A comma-separated list of field paths with values that are the parameters to the subject text. The order of the field specified determines the order of the parameters. | Yes |
  email.body.string.key |  | A key for the application text for the body of the email. | Yes |
  email.body.parameter.fields |  | A comma-separated list of field paths with values that are the parameters to the body text. The order of the field specified determines the order of the parameters. | Yes |
  email.old.subject.string.key |  | A key for the application text for the subject of the email sent to the old user. | No |
  email.old.subject.parameter.fields |  | A comma-separated list of field paths with values that are the parameters to the subject text of the email sent to the old user. The order of the field specified determines the order of the parameters. | No |
  email.old.body.string.key |  | A key for the application text for the body of the email sent to the old user. | No |
  email.old.body.parameter.fields |  | A comma-separated list of field paths with values that are the parameters to the body text of the email sent to the old user. The order of the field specified determines the order of the parameters. | No |
  ignore.failure | true false | A parameter, specifies whether the email should be sent out when there's an error. | No |
  application.url.path |  | The server information of the OpenPages Application. Required for formating a link to the object. (i.e. "http://:/") | Yes |
  mail.timeout |  | The sending email's timeout in seconds. Default is 30 seconds. | No |
  mail.retry.times |  | The retry times of sending email. Default is 3. | No |

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SendEmailEventHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `handleEvent(CreateResourceEvent event)` Handles create resource event.
    `boolean` | `handleEvent(CreateResourceWithRelationsEvent event)` Handles create resource with relations event.
    `boolean` | `handleEvent(UpdateResourceEvent event)` Handles update resource event.

    - ### Methods inherited from class com.ibm.openpages.api.trigger.ext.DefaultEventHandler

      `handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent`

    - ### Methods inherited from class com.ibm.openpages.api.trigger.AbstractEventHandler

      `getAttributes, getRuleAttributes, setAttributes, setRuleAttributes, throwException`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SendEmailEventHandler

          public SendEmailEventHandler()

  - ### Method Detail

    - #### handleEvent

          public boolean handleEvent(CreateResourceEvent event)

      Handles create resource event.
      Overrides:
        `handleEvent` in class `DefaultEventHandler`
      Parameters:
        `event` - a create resource event to be handled
      Returns:
        true.

    - #### handleEvent

          public boolean handleEvent(CreateResourceWithRelationsEvent event)

      Handles create resource with relations event.
      Overrides:
        `handleEvent` in class `DefaultEventHandler`
      Parameters:
        `event` - a create resource with relations event to be handled
      Returns:
        true.

    - #### handleEvent

          public boolean handleEvent(UpdateResourceEvent event)

      Handles update resource event.
      Overrides:
        `handleEvent` in class `DefaultEventHandler`
      Parameters:
        `event` - an update resource event to be handled
      Returns:
        true

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2021. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.