Working with the job completion notification e-mail message template
BIRT iHub uses an XML file as a template for creating the e-mail notification of a completed job. You can customize the job completion notification e-mail using the XML file, acnotification.xml, as shown in Listing 4‑4. AC_CONFIG_HOME contains this file.
The acnotification.xml file uses UTF-8 encoding.
Listing 4‑4 Viewing acnotification.xml
<?xml version="1.0" encoding="UTF-8"?>
<notificationTemplate version="1.0">
<successMessage>
<subject>Actuate iHub Notification</subject>
<body>
<!-- Body Text Begin -->
Actuate iHub - Report <insert variable="jobType"/> complete
 
For Information Console:
Report: <insert variable="reportLink"/>
 
If the URL above does not work, copy the entire link and paste it into the address bar of your web browser, then press Enter or Return.
 
Completed at: <insert variable="jobCompletion"></insert>
 
Note: If the job submitter requested that you receive the report as an attachment to this email, but the report is not attached, then you might not have the privileges required to view the entire report. Please contact your system administrator.
<!-- Body Text End -->
</body>
</successMessage>
<failureMessage>
<subject>Actuate iHub Notification</subject>
<body>
<!-- Body Text Begin -->
Actuate iHub - Report <insert variable="jobType"/> failed.
 
For Information Console:
Report: <insert variable="reportLink"/>
 
If the URL above does not work, copy the entire link and paste it into the address bar of your web browser, then press Enter or Return.
 
Completed at: <insert variable="jobCompletion"></insert>
 
Warning/Error:
<insert variable="jobDetailedStatus"/>
<!-- Body Text End -->
</body>
</failureMessage>
</notificationTemplate>
Listing 4‑5 shows the text of an e-mail message that uses the default acnotification.xml file.
Listing 4‑5 Viewing a job completion e-mail notification
Actuate iHub - Report Execution complete
 
For Information Console:
Report: http://HULU:8700/iportal/iv?__report=/Home/administrator/Sales%20and%20Profit%20Analysis%20by%20Country.RPTDOCUMENT%3B3&volume=Default%20Volume&repositoryType=enterprise
 
If the URL above does not work, copy the entire link and paste it into the address bar of your web browser, then press Enter or Return.
 
Completed at: Monday, May 04, 2015 1:47:31 PM Pacific Standard Time
 
Note: If the job submitter requested that you receive the report as an attachment to this email, but the report is not attached, then you might not have the privileges required to view the entire report. Please contact your system administrator.
About e-mail template elements and attributes
Table 4‑2 describes the e-mail template elements and attributes.
Table 4‑2 E-mail template elements and attributes
E-mail template elements and attributes
Description
notificationTemplate element
Required root element of the e-mail notification template
version attribute
Required notification template attribute. Specifies the version number of the notification template file
failureMessage element
Parent element of the subject and body elements for a failed job e-mail notification.
successMessage element
Parent element of the subject and body elements for a successful job e-mail notification
subject element
Element that specifies the content of the subject line
body element
Element that specifies the content of the e-mail body
email-content-type attribute
Optional body element attribute that specifies the type of the body content
insert element
Optional element that inserts job and document information in subject or body message content
variable attribute
Required insert element attribute that specifies the information to insert in the e-mail subject or body
About variable attribute values
Table 4‑3 describes the valid variable attribute values.
Table 4‑3 Values for variable attribute
Variable attribute value
Description
jobCompletion
Date and time of job completion.
jobDetailedStatus
Detailed status of the job. Detail information from the jobstatus page.
jobHeadline
Job headline.
jobName
Job name.
jobStatus
Status of job. Either completed or failed.
jobSubmitter
Job submitter user name.
jobType
Type of job. Either Execution or Printing.
reportDocumentName
Document name. Available for a successful job.
reportDocumentVersionName
Document version name. Available for a successful job.
reportDocumentVersionNumber
Document version number. Available for a successful job.
reportLink
Hyperlink to access a document in the volume. For a failed job, the link accesses the job status page.
The following example uses the insert element reportLink variable to display the URL for the document:
Report: <insert variable=”reportLink” />
Using HTML in the e-mail template
To use HTML in the successMessage or failureMessage element, set the email-content-type attribute to text/html:
<body email-content-type="text/html">
Enclose the HTML in CDATA sections. Place insert elements outside the CDATA sections. The following example shows a successMessage element with HTML formatting:
<?xml version="1.0" encoding="UTF-8" ?>
<notificationTemplate>
<successMessage>
<subject>
Report Delivery Notification: <insert variable="jobHeadline"/>
</subject>
<body email-content-type="text/html">
<![CDATA[
<html>
<body>
<h2>
]]>
<insert variable="jobHeadline"/>
<![CDATA[
</h2>
]]>
Version <insert variable="reportDocumentVersionNumber"/>
of report <insert variable="reportDocumentName"/>
is now available online.
<![CDATA[
<a href="
]]>
<insert variable="reportLink"/>
<![CDATA[
">Go to Report</a>
<p>
<table border="1pt;">
<tr><td>Report Submitter: </td><td>
]]>
<insert variable="jobSubmitter"/>
<![CDATA[
</td></tr>
<tr><td>Report Generation Date: </td>
<td>
]]>
<insert variable="jobCompletion"/>
<![CDATA[
</td>
</tr>
</table>
<br><br>
</body>
</html>
]]>
</body>
</successMessage>
If your e-mail server supports HTML, the message header and body look similar to Figure 4‑1.
Figure 4‑1 Viewing the message and body of an HTML e‑mail