Sending Emails at the Conclusion of Batch Processes
It is possible to send a notification email when a batch process has ended. This notification happens after the batch process has ended and all application-related commits or rollbacks have taken place. It does not impact the batch process itself in the event of errors happening during the notification process. The default email is a simple text email that contains the batch control, date and time of the submission, run number, submission parameters, batch process summary indicating records processed and in-error, as well as the thread details, including logged messages (up to 100).
The email address can be an individual person or a valid mail group (the latter requires additional configuration in your email system).
To use email notification the email server must be configure using one of the following options:
1. The mail server can be defined through the default Message Sender (Class RTEMAILSNDR) with the appropriate SMTP settings on the Context tab.
2. Alternatively the properties can be supplied in the form of JVM properties as follows:
# Host whose mail services will be used
# (Default value : localhost)
mail.host=<your mail server>
# Return address to appear on emails
# (Default value : username@host)
mail.from=<name@host>
# Other possible items include:
# mail.user=
# mail.store.protocol=
# mail.transport.protocol=
# mail.smtp.host=
# mail.smtp.user=
# mail.debug=
Name
Type
Description
mail.smtp.class
String
Specifies the fully qualified class name of the provider for the specified protocol. Used in cases where more than one provider for a given protocol exists; this property can be used to specify which provider to use by default. The provider must still be listed in a configuration file.
mail.smtp.host
String
The host name of the mail server for the specified protocol. Overrides the mail.host property.
mail.smtp.port
int
The port number of the mail server for the specified protocol. If not specified, the protocol's default port number is used.
mail.smtp.user
String
The username to use when connecting to mail servers using the specified protocol. Overrides the mail.user property.
mail.store.protocol
String
Specifies the default message access protocol. The Session method getStore() returns a Store object that implements this protocol. By default, the first Store provider in the configuration files is returned.
mail.transport.protocol
String
Specifies the default message access protocol. The Session method getTransport() returns a Transport object that implements this protocol. By default the first Transport provider in the configuration files is returned.
mail.user
String
The default username to use when connecting to the mail server. Used if the mail.protocol.user property isn't set
These properties can be added to the threadpoolworker.properties file for the standalone batch threadpoolworker, or the spl.properties file for an online application server that hosts a batch worker.