public class EmailUtils extends Object
| Constructor and Description |
|---|
EmailUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
sendEmail(State state,
String subject,
String message)
A general method for sending emails.
|
static void |
sendJobCancellationEmail(String jobId,
String message,
State jobState)
Send a job cancellation notification email.
|
static void |
sendJobCompletionEmail(String jobId,
String message,
String state,
State jobState)
Send a job completion notification email.
|
static void |
sendJobFailureAlertEmail(String jobName,
String message,
int failures,
State jobState)
Send a job failure alert email.
|
public static void sendEmail(State state, String subject, String message) throws org.apache.commons.mail.EmailException
state - a State object containing configuration propertiessubject - email subjectmessage - email messageorg.apache.commons.mail.EmailException - if there is anything wrong sending the emailpublic static void sendJobCompletionEmail(String jobId, String message, String state, State jobState) throws org.apache.commons.mail.EmailException
jobId - job namemessage - email messagestate - job statejobState - a State object carrying job configuration propertiesorg.apache.commons.mail.EmailException - if there is anything wrong sending the emailpublic static void sendJobCancellationEmail(String jobId, String message, State jobState) throws org.apache.commons.mail.EmailException
jobId - job namemessage - email messagejobState - a State object carrying job configuration propertiesorg.apache.commons.mail.EmailException - if there is anything wrong sending the emailpublic static void sendJobFailureAlertEmail(String jobName, String message, int failures, State jobState) throws org.apache.commons.mail.EmailException
jobName - job namemessage - email messagefailures - number of consecutive job failuresjobState - a State object carrying job configuration propertiesorg.apache.commons.mail.EmailException - if there is anything wrong sending the email