Try OpenEdge Now
skip to main content
BP Server Developer's Guide
E-mail templates for task completion : HTML e-mail templates : Guidelines for custom template
 

Guidelines for custom template

The following section provides the guidelines for a custom template.

Guidelines

*The header.htl must be inserted after the <head> tag.
*The footer.htl must be inserted before the </body> tag.
*Define the form with the name sbmDataForm and invoke the JavaScript completeEmailTask() on submit of this form. For example, <input type="button" name="completeTask" value="Complete Task" onClick="completeEmailTask();">
*All input fields should be defined with a "disabled" attribute. For example, <input name=‘dsName’ type=‘text’ value=‘${dsName}’ disabled>
*JavaScript completeEmailTask() must be defined in the header.htl and this function and all dependent functions should not be modified.
*You may add new reusable JavaScript functions and Stylesheets that are common to all templates in the header.htl.
*Any application specific JavaScript and/or Stylesheets should be added only to individual custom templates and not to the header.htl.
*Custom templates should use well formed HTML.
*E-mail clients do not resolve HTML tags with reference to external files using file protocol or relative /absolute path. However, they may work fine if the references are using http protocol.
*If the custom template’s application specific stylesheet conflicts with the stylesheet in the header.htl, then you can define the application specific stylesheet inside the <body> tag.

An example of custom HTML template

<html>
<head>
<!– header.htl is inserted here ---?
<title>Product Selection</title>
</head>
<body><br/>
<table border="1" cellspacing="1" cellpadding="1">
  <tr>
    <td width="50%" nowrap>Instance Name: &nbsp;${PCTX.INSTANCE_NAME}&nbsp;</td>
    <td width="50%" nowrap>Workstep Name: &nbsp;${PCTX.WS_NAME}</td>
   </tr>
   <tr>
    <td>Priority: &nbsp; ${PCTX.WS_PRIORITY}</td>
    <td>Due Date: &nbsp; ${PCTX.WS_DUE_DATE}</td>
   </tr>
</table>
<br/><br/>
<form name="sbmDataForm" method="POST" >
  <table border="1" cellspacing="1" cellpadding="1">
   <tr>
    <td>&nbsp;Name</td>
    <td>&nbsp;<input name="name" type="text" value="${name}" ></td>
   </tr>
   <tr>
    <td>&nbsp;Price</td>
    <td>&nbsp;<input name="price" type="text" value="${price}" ></td>
   </tr>
  </table>
  <input type="button" name="completeTask" value="Complete Task"
onClick="completeEmailTask();">
</form>
<!– footer.htl is inserted here ---?
</body>
</html>
$EMAIL.SUBJECT=Select Product Task <${PCTX.WI_ID}>