Creating status templates for outgoing email
To include status templates with outgoing email
Create a status template.
The following sample HTML template is created to display the status:<html>
<head>
<title>Status Template</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso- 8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="75%" border="1" cellspacing="1" cellpadding="3">
<tr>
<td colspan="4">
<div align="center"><b>Your request to the AR Server returned the following error. If you have questions, contact your <a href="mail%20to:%20stamps1@eng.bmc.com">Administrator</a>.</b></div>
</td>
</tr>
<tr>
<td width="12%">Error Number</td>
<td width="28%">#$$ActionStatus.Number$$#</td>
<td width="18%">Message 1</td>
<td width="42%">#$$ActionStatus.Text$$#</td>
</tr>
<tr>
<td width="12%">Error Type</td>
<td width="28%">#$$ActionStatus.Type$$#</td>
<td width="18%">Message 2</td>
<td width="42%">#$$ActionStatus.AppendedText$$#</td>
</tr>
</table>
</body>
</html>This HTML template defines a simple table with two rows for the error number and error types. It also includes an email address that users can respond to if they have questions.
Your HTML template could also include color and special fonts.- Create an entry in the AR System Email Templates form for your status template, for example, Status_default.html.
For more information, see Adding-and-modifying-attachments-in-HTML-templates. - Open the outgoing mailbox entry in the AR System Email Mailbox Configuration form.
- Under the Advanced Configuration tab, specify Status_default.html as the status template.
- (Optional) Include a header or footer template.
The sample email shown in the following figure uses the default header template configured for the outgoing mailbox. - Send an incoming email to the Email Engine that will generate an outgoing status email, for example, a query that returns no records.
The following figure displays the outgoing status email generated by the Email Engine.
An outgoing message with the default header and HTML status templates
Including incoming body in outgoing email
By default, outgoing error messages generated by Email Engine do not contain the body of the original incoming email request. To help users troubleshoot failed email requests for submit, modify, and query actions, use the variable #$$ORIGINALMAIL$$# to include the incoming body in outgoing messages.
To include the incoming body in outgoing email
- Add the variable #$$ORIGINALMAIL$$# to a status template.
Associate the status template with your system's outgoing email messages.
See To include status templates with outgoing email above.
When Email Engine generates an error message based on a status template containing the variable #$$ORIGINALMAIL$$#, it replaces the variable with the body of the original email message.
For example, a user submits an email request that includes this information:Schema: HD Incident
Server: reepicheep.eng.bmc.com
Login: Demo
Password:
Action: Submit
Description !8!: My mouse isn't working.
StatusTemplate: MyStatusTemplateThe status template associated with the user's request, MyStatusTemplate, includes these label/value pairs:
Error Number: #$$ActionStatus.Number$$#
Error Type: #$$ActionStatus.Type$$#
Error Text: #$$ActionStatus.Text$$#
Error Appended Text: #$$ActionStatus.AppendedText$$#
Error Appended Text: #$$ActionStatus.AppendedText$$#
Original Mail: #$$ORIGINALMAIL$$#If the user's submission fails, Email Engine generates an error message based on MyStatusTemplate. Because the value of the Original Mail label in that template is the variable #$$ORIGINALMAIL$$#, the original email body is put in place of that variable in the error message:
Error Number: 307
Error Type: 2
Error Text: Required field (without a default) not specified
Error Appended Text: 2
Original Mail:
Schema: HD Incident
Server: reepicheep.eng.bmc.com
Login: Demo
Password:
Action: Submit
Description !8!: My mouse isn't working.
StatusTemplate: MyStatusTemplate
Including incoming attachments in outgoing email
To include attachments to incoming requests in outgoing error messages, the associated status template must contain the variable #$$ORIGINALMAIL$$#, and the incoming request must contain the following information:
- Correct login, password, server, and schema (form name) values
- IDs of the attachment fields
- Names of the attached files
For example, a user submits an email request that includes this information:
Server: reepicheep.eng.bmc.com
Login: Demo
Password:
Action: Submit
Description !8!: I need a new mouse for my computer.
StatusTemplate: MyStatusTemplate
!536880912!: file1.txt
!536880913!: file2.txt
Using that information, Email Engine gets the appropriate HD Incident form from the specified server and then gets the attachment information from the specified attachment fields. If the HD Incident form does not contain field 536880913, Email Engine cannot get file2.txt. Thus, if the submission fails, the user receives an error message that includes the original email message and only one attachment, file1.txt.