The JITL jobs JSSmtpMailClientAdapter and SmtpMailMonitor are included since JobScheduler Release 1.5.3253.
These job is now without a documentation. It is useful for sending emails.
It contains all parameters like the JobSchedulerManagedMailJob.
SmtpMailMonitor can used for a pre- or post-processing.
Example job using com.sos.jitl.mail.smtp.SmtpMailMonitor:
For this job you should use prefixes "MailOnSuccess_", "MailOnError_" and "MailOnJobStart_".
- Prefix "MailOnJobStart_" for sending mail before the job runs
- Prefix "MailOnSuccess_" for sending mail after the job has run successfully
- Prefix "MailOnError_" for sending mail after the job has run with an error
For each prefix you can specify e.g. different recipients.
Example for prefix MailOnSuccess_
You want that a job should sends a mail in the case of an error in the normal way via the JobScheduler mail notification.
This mail has the task log as attachment.
Further you want a success mail but without the task log, so deactivate the mail via JobScheduler (see <settings> in the following example) and
specify some parameter with the "MailOnSuccess_" prefix.
Example job using com.sos.jitl.mail.smtp.JSSmtpMailClientAdapterClass:
Example for substitute parameters
The can substitute its parameters with other parameters.
We assume that we have a job chain with two jobs. The first job transfers files and if the first job has an error than the seconds job starts to send an email. Otherwise the job chain ends after the first job. The body of the email should have the error of the first job.
The first job writes its last error in a post-processing into the order parameter with the name last_error and the mail job has a parameter
for the body. Then the value of the last_error parameter is substituted into the body parameter.
Configuration of the job chain
Configuration of the first job for file transfer
Configuration of the second job for sending mails in the case of an error