Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

MailFragment

Attributes

MailFragment

Attributes

The MailFragmentThe MailFragment element supports the following attributes:

AttributeUsageDescription
nameRequiredUnique name of the fragment.
job_resourcesRequiredA list of JS7 - Job Resources that specify mail server connection settings.
content_typeOptional

Content type of the e-mail.

Possible values:

  • text/plain
  • text/html.


Default: text/html

charsetOptional

Charset of the e-mail.


Default: ISO-8859-1

encodingOptional

Encoding of the e-mail.

Possible values:

  • 7bit
  • Quoted-Printable
  • Base64.


Default: 7bit

priorityOptional

Priority of the e-mail.

Possible values:

  • Highest
  • High
  • Normal


Default: Normal

Attributes from Job Resources 

The following settings must be provided by one of the a Job Resources Resource that are is assigned a MailFragment:

AttributeUsageDescription
mail.smtp.hostRequiredHost name or IP address of the mail server.

...

Optional settings include - but are not limited to - settings specific for your the mail server, e.g. for authentication:

AttributeUsageDescription
mail.smtp.portOptional

The port number for SMTP access to the mail server. Frequent port numbers include:

  • 25 (plain text)
  • 465 (TLS)
  • 587 (SSL)
mail.smtp.timeoutOptional

Socket read timeout for mail server connection.

mail.smtp.connectiontimeoutOptionalSocket connection timeout for mail server.
mail.smtp.userOptionalUser name for the account that sends e-mail, for example user@domain.
mail.smtp.passwordOptionalPassword for the account that sends e-mail.
mail.smtp.ssl.protocolsenableOptionalEnables SSL
mail.smtp.starttls.enableOptionalEnables TLS
mail.smtp.ssl.protocolsOptional

Specifies the TLS protocol version should a TLS/SSL connection be used:

  • TLSv1 (considered insecure)
  • TLSv1.1 (considered insecure)
  • TLSv1.2
Specifies the TLS protocol version, e.g. TLSv1, TLSv1.1, TLSv1.2, should an SSL connection be used


Basically, any settings with the prefix mail.smtp. can be assigned configured with a Job Resource which that is used with assigned the MailFragment. JS7 makes use of JavaMail: a list of available settings for example can be found at, for example, httpsat https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html.

...

AttributeUsageDescription
fromOptional

E-mail address of the account that sends e-mail.

from_nameOptionalName for the E-mail address of the account that sends e-mail.
toOptionalE-mail address of the recipient(s) of a notification e-mail.
ccOptionalE-mail address of the recipient(s) of a carbon copy notification e-mail.
bccOptionalE-mail address of recipient(s) of a blind carbon copy notification e-mail.

Elements

The following elements are nested inside the MailFragment element:

ElementElement descriptionDescription
MessageRefRequired, only once inside of the MailFragment elementBody of an e-mail notification that is provided by the referenced Message element.
SubjectRequired, only once inside of the MailFragment elementSubject of an e-mail notification.
FromOptional or only once inside of the MailFragment elementE-mail address of the account that sends e-mail.
ToOptional or only once inside of the MailFragment elementE-mail address of the recipient(s) of a notification e-mail.
CCOptional or only once inside of the MailFragment elementE-mail address of the recipient(s) of a carbon copy notification e-mail.
BCCOptional or only once inside of the MailFragment elementE-mail address of recipient(s) of a blind carbon copy notification e-mail.

Subject

Subject of an e-mail notification.

The Subject can contain Monitor Variables.include JS7 - Notification - Configuration, Monitor Variables.

Example for generic Subject Element  in the event of Success and Failure

  • The ${MON_N_TYPE} monitor variable will be substituted by one of the values: SUCCESS, WARNINGERROR, RECOVERED

Code Block
languagexml
titleExample
collapsetrue
for generic Subject Element in case of success or failure
JS7...
<Subject><![CDATA[JS7 JobScheduler Notification: ${MON_N_TYPE} - Order ID: ${MON_O_ORDER_ID} - Workflow: ${MON_O_WORKFLOW_PATH}]]></Subject>
...

 MessageRef

The Message element referenced specifies the body of an e-mail notification.

The Message can contain Monitor Variables.

Example for Subject Element in the event of Success

Code Block
languagexml
titleExample
collapsetrue
for Subject Element in case of success
JS7 JobScheduler Notification: SUCCESS - Order ID: ${MON_O_ORDER_ID} - Workflow: ${MON_O_WORKFLOW_PATH}

Example for Subject Element in the event of Failure

Code Block
languagexml
titleExample for Subject Element in case of failure
JS7 JobScheduler Notification: FAILURE - Order ID: ${MON_O_ORDER_ID} - Workflow: ${MON_O_WORKFLOW_PATH}

MessageRef

The Message element referenced specifies the body of an e-mail notification.

Example for HTML E-Mail Body in the event of Success

Code Block
languagexml
titleExample for HTML E-Mail body in case of success
collapsetrue
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <style>.tg  {border-collapse:collapse;border-spacing:0;border-color:#bbb;}.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#bbb;color:#594F4F;background-color:#fff;}.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:bold;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#bbb;color:#fff;background-color:#9DE0AD}</style>
    <title>JS7 JobScheduler Notification</title>
</head>
<body>
    <table class="tg">
<Message name="mail_on_failure"><![CDATA[
<body>
    <style type="text/css">.tg  {border-collapse:collapse;border-spacing:0;border-color:#aaa;}.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;}.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;}</style>
    <table class="tg">
        <tr>
            <th colspan="4">Error/Warning</th>
        </tr>
        <tr>
            <td>Return Code:</td>
<tr>
             <td>${MON_OS_RETURN_CODE}</td><th colspan="4">Controller</th>
            <td>Message:</td>tr>
        <tr>
    <td>${MON_OS_ERROR_TEXT}</td>
        <td>Controller ID:</tr>td>
        <tr>    <td>${MON_O_CONTROLLER_ID}</td>
            <td>Error Code<td>Agent URI:</td>
            <td>${MON_OS_ERRORAGENT_CODEURI}</td>
            <td>Warning:</td>
            <td>${MON_OS_WARN_TEXT}</td>
        <</tr>
        <tr>
            <th colspan="4">Controller<>Order</th>
        </tr>
        <tr>
            <td>Controller ID<td>Order ID:</td>
            <td>${MON_O_CONTROLLER_ID}</td><td colspan="3">
            <td>Agent URI:</td>    <a href="${JOC_HREF_ORDER}">${MON_O_ORDER_ID}</a>
            <td>${MON_OS_AGENT_URI}</td>
        </tr>
        <tr>
            <th colspan="4">Order</th><td>Order Log:</td>
        </tr>
    <td colspan="3">
    <tr>
            <td>Order ID:</td>
            <td>
                <a href="${JOC_HREF_ORDER_LOG}">${MONJOC_OHREF_ORDER_IDLOG}</a>
            </td>
            <td>Order Title:</td>tr>
        <tr>
    <td>${MON_O_TITLE}</td>
        <td>Workflow Path:</tr>td>
        <tr>
            <td>Order Log:</td>
            <td colspan="3"><td>
                <a href="${JOC_HREF_ORDER_LOGWORKFLOW}">${JOCMON_HREFO_ORDERWORKFLOW_LOGPATH}</a>
            </td>
        </tr>
        <tr><td>Workflow Title:</td>
            <td>Workflow Path:<<td>${MON_O_WORKFLOW_TITLE}</td>
        </tr>
        <tr>
            <td>Job Name:</td>
            <td>
                <a href="${JOC_HREF_WORKFLOWJOB}">${MON_OOS_WORKFLOWJOB_PATHNAME}</a>
            </td>
            <td>Workflow Title<td>Job Title:</td>
            <td>${MON_OOS_WORKFLOWJOB_TITLE}</td>
        </tr>
        <tr>
            <td>Job Name<td>Job Label:</td>
            <td>
                <a href="${JOC_HREF_JOB}">${MON_<td>${MON_OS_JOB_NAME}</a>
            LABEL}</td>
            <td>Job Title<td>Job Criticality:</td>
            <td>${MON_OS_JOB_TITLECRITICALITY}</td>
        </tr>
        <tr>
            <td>Job Label<td>Job Log:</td>
            <td>${MON_OS_JOB_LABEL}</td>
<td colspan="3">
              <td>Job Criticality:</td>  <a href="${JOC_HREF_JOB_LOG}">${JOC_HREF_JOB_LOG}</a>
            <td>${MON_OS_JOB_CRITICALITY}</td>
        </tr>
        <tr>
            <th colspan="4">Order History</th>
        </tr>
        <tr>
            <td>Status:</td>
            <td>${MON_O_SEVERITY}</td>
            <td>Time elapsed:</td>
            <td>${MON_O_TIME_ELAPSED}</td>
        </tr>
        <tr>
            <td>Start Time UTC:</td>
            <td>${MON_O_START_TIME}</td>
            <td>End Time UTC:</td>
            <td>${MON_O_END_TIME}</td>
        </tr>
        <tr>
            <th colspan="4">Order Step History</th>
        </tr>
        <tr>
            <td>Status:</td>
            <td>${MON_OS_SEVERITY}</td>
            <td>Time elapsed:</td>
            <td>${MON_OS_TIME_ELAPSED}</td>
        </tr>
        <tr>
            <td>Start Time UTC:</td>
            <td>${MON_OS_START_TIME}</td>
            <td>End Time UTC:</td>
            <td>${MON_OS_END_TIME}</td>
        </tr>
    </table>
</body>
</html>

Example for HTML E-Mail Body in the event of Failure

  • Download: mail_on_failure.html
  • Users can paste the example listed below as input to the Message element.

Code Block
languagexml
titleExample for HTML E-Mail body in case of failure
collapsetrue
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <style>.tg  {border-collapse:collapse;border-spacing:0;border-color:#aaa;}.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;}.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:bold;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;}</style>
    <title>JS7 JobScheduler Notification</title>
</head>
<body>
    <table class="tg">
        <tr>
            <th colspan="4">Error/Warning</th>
        </tr>
        <tr>
            <td>Return Code:</td>
            <td>${MON_OS_RETURN_CODE}</td>
            <td>Message:</td>
            <td>${MON_OS_ERROR_TEXT}</td>
        </tr>
        <tr>
            <td>Error Code:</td>
            <td>${MON_OS_ERROR_CODE}</td>
            <td>Warning:</td>
            <td>${MON_OS_WARN_TEXT}</td>
        </tr>
        <tr>
            <th colspan="4">Controller</th>
        </tr>
        <tr>
            <td>Controller ID:</td>
            <td>${MON_O_CONTROLLER_ID}</td>
            <td>Agent URI:</td>
            <td>${MON_OS_AGENT_URI}</td>
        </tr>
        <tr>
            <th colspan="4">Order</th>
        </tr>
        <tr>
            <td>Order ID:</td>
            <td colspan="3">
                <a href="${JOC_HREF_ORDER}">${MON_O_ORDER_ID}</a>
            </td>
        </tr>
        <tr>
            <td>Order Log:</td>
            <td colspan="3">
                <a href="${JOC_HREF_ORDER_LOG}">${JOC_HREF_ORDER_LOG}</a>
            </td>
        </tr>
        <tr>
            <td>Workflow Path:</td>
            <td>
                <a href="${JOC_HREF_WORKFLOW}">${MON_O_WORKFLOW_PATH}</a>
            </td>
            <td>Workflow Title:</td>
            <td>${MON_O_WORKFLOW_TITLE}</td>
        </tr>
        <tr>
            <td>Job Name:</td>
            <td>
                <a href="${JOC_HREF_JOB}">${MON_OS_JOB_NAME}</a>
            </td>
            <td>Job Title:</td>
            <td>${MON_OS_JOB_TITLE}</td>
        </tr>
        <tr>
            <td>Job Label:</td>
            <td>${MON_OS_JOB_LABEL}</td>
            <td>Job Criticality:</td>
            <td>${MON_OS_JOB_CRITICALITY}</td>
        </tr>
        <tr>
            <td>Job Log:</td>
            <td colspan="3">
                <a href="${JOC_HREF_JOB_LOG}">${JOC_HREF_JOB_LOG}</a>
            </td>
        </tr>
        <tr>
            <th colspan="4">Order History</th>
        </tr>
        <tr>
            <td>Status:</td>
            <td>${MON_O_SEVERITY}</td>
            <td>Time elapsed:</td>
            <td>${MON_O_TIME_ELAPSED}</td>
        </tr>
        <tr>
            <td>Start Time UTC:</td>
            <td>${MON_O_START_TIME}</td>
            <td>End Time UTC:</td>
            <td>${MON_O_END_TIME}</td>
        </tr>
        <tr>
            <th colspan="4">Order Step History</th>
        </tr>
        <tr>
            <td>Status:</td>
            <td>${MON_OS_SEVERITY}</td>
            <td>Time elapsed:</td>
            <td>${MON_OS_TIME_ELAPSED}</td>
        </tr>
        <tr>
            <td>Start Time UTC:</td>
            <td>${MON_OS_START_TIME}</td>
            <td>End Time UTC:</td>
            <td>${MON_OS_END_TIME}</td>
        </tr>
    </table>
</body>
</html>

Example for TEXT E-Mail Body in the event of Success

  • Download: mail_on_success.txt
  • Users can paste the example listed below as input to the Message element.

Code Block
languagexml
titleExample for TEXT E-Mail body in case of success
collapsetrue
* CONTROLLER *\n
----------------------------------------\n
** Controller ID: ${MON_O_CONTROLLER_ID}\n
** Agent URL: ${MON_OS_AGENT_URI}\n
\n
\n
* ORDER *\n
----------------------------------------\n
** Order ID: ${MON_O_ORDER_ID} ${JOC_HREF_ORDER}\n
** Order Log: ${JOC_HREF_ORDER_LOG}\n
\n
\n
* WORKFLOW *\n
----------------------------------------\n
** Workflow Path: ${MON_O_WORKFLOW_PATH} ${JOC_HREF_WORKFLOW}\n
** Workflow Title: ${MON_O_WORKFLOW_TITLE}\n
** Job Name: ${MON_OS_JOB_NAME} ${JOC_HREF_JOB}\n
** Job Title: ${MON_OS_JOB_TITLE}\n
** Job Label: ${MON_OS_JOB_LABEL}\n
** Job Criticality: ${MON_OS_JOB_CRITICALITY}\n
** Job Log: ${JOC_HREF_JOB_LOG}\n
\n
\n
* ORDER HISTORY *\n
----------------------------------------\n
** Status: ${MON_O_SEVERITY}\n
** Time elapsed: ${MON_O_TIME_ELAPSED}\n
** Start Time: ${MON_O_START_TIME}\n
** End Time: ${MON_O_END_TIME}\n
\n
\n
* ORDER STEP HISTORY *\n
----------------------------------------\n
** Status: ${MON_OS_SEVERITY}\n
** Time elapsed: ${MON_OS_TIME_ELAPSED}\n
** Start Time: ${MON_OS_START_TIME}\n
** End Time: ${MON_OS_END_TIME}\n

Example for TEXT E-Mail Body in the event of Failure

  • Download: mail_on_failure.txt
  • Users can paste the below example as input to the Message element.

Code Block
languagexml
titleExample for TEXT E-Mail body in case of failure
collapsetrue
* ERROR /       <td>Job Log:</td>
            <td colspan="3">
                <a href="${JOC_HREF_JOB_LOG}">${JOC_HREF_JOB_LOG}</a>
            </td>
        </tr>
        <tr>
            <th colspan="4">Order History</th>
        </tr>
        <tr>
            <td>Status:</td>
            <td>${MON_O_SEVERITY}</td>
            <td>Time elapsed:</td>
            <td>${MON_O_TIME_ELAPSED}</td>
        </tr>
        <tr>
            <td>Start Time UTC:</td>
            <td>${MON_O_START_TIME}</td>
            <td>End Time UTC:</td>
            <td>${MON_O_END_TIME}</td>
        </tr>
        <tr>
            <th colspan="4">Order Step History</th>
        </tr>
        <tr>
            <td>Status:</td>
            <td>${MON_OS_SEVERITY}</td>
            <td>Time elapsed:</td>
            <td>${MON_OS_TIME_ELAPSED}</td>
        </tr>
        <tr>
            <td>Start Time UTC:</td>
            <td>${MON_OS_START_TIME}</td>
            <td>End Time UTC:</td>
            <td>${MON_OS_END_TIME}</td>
        </tr>
    </table>
</body>
]]></Message>
WARNING *\n
----------------------------------------\n
** Return Code: ${MON_OS_RETURN_CODE}\n
** Error Code: ${MON_OS_ERROR_CODE}\n
** Message: ${MON_OS_ERROR_TEXT}\n
** Warning: ${MON_OS_WARN_TEXT}\n
\n
\n
* CONTROLLER *\n
----------------------------------------\n
** Controller ID: ${MON_O_CONTROLLER_ID}\n
** Agent URL: ${MON_OS_AGENT_URI}\n
\n
\n
* ORDER *\n
----------------------------------------\n
** Order ID: ${MON_O_ORDER_ID} ${JOC_HREF_ORDER}\n
** Order Log: ${JOC_HREF_ORDER_LOG}\n
\n
\n
* WORKFLOW *\n
----------------------------------------\n
** Workflow Path: ${MON_O_WORKFLOW_PATH} ${JOC_HREF_WORKFLOW}\n
** Workflow Title: ${MON_O_WORKFLOW_TITLE}\n
** Job Name: ${MON_OS_JOB_NAME} ${JOC_HREF_JOB}\n
** Job Title: ${MON_OS_JOB_TITLE}\n
** Job Label: ${MON_OS_JOB_LABEL}\n
** Job Criticality: ${MON_OS_JOB_CRITICALITY}\n
** Job Log: ${JOC_HREF_JOB_LOG}\n
\n
\n
* ORDER HISTORY *\n
----------------------------------------\n
** Status: ${MON_O_SEVERITY}\n
** Time elapsed: ${MON_O_TIME_ELAPSED}\n
** Start Time: ${MON_O_START_TIME}\n
** End Time: ${MON_O_END_TIME}\n
\n
\n
* ORDER STEP HISTORY *\n
----------------------------------------\n
** Status: ${MON_OS_SEVERITY}\n
** Time elapsed: ${MON_OS_TIME_ELAPSED}\n
** Start Time: ${MON_OS_START_TIME}\n
** End Time: ${MON_OS_END_TIME}\n

Further Resources

Display content by label
Labelsjs7 troubleshooting e-mail
OtherTitleTroubleshooting