Creating result templates for outgoing email
To use XML with outgoing email
Create a template file (for example, result_employee.xml) using XML format:
<?xml version="1.0" encoding="UTF-8" ?>
<Employee name="#$$Employee Name$$#">
<age>#$$Age$$#</age>
<salary>#$$Salary$$#</salary>
<address>
<street>#$$Street$$#</street>
<city>#$$City$$#</city>
<state>#$$State$$#</state>
<zip>#$$Zip$$#</zip>
</address>
</Employee>This simple example contains an XML attribute (name), an attribute value (#$$Employee Name$$#), and several elements (age) with their values (#$$Age$$#).
- Add the template as a text template to the AR System Email Template form.
The name of this XML template is employee.
For information, see Storing templates in the AR System Email Templates form. Send an incoming email to the Email Engine that queries the server and returns the results using the XML template, for example:
Action:Query
User: Demo
Server:polycarp
Schema:employee
Result Template:employee
Employee Name \! 536870913\!:John DoeThis email specifies that the employee XML template be used in the outgoing email to return the results of the query.
The following figure displays the outgoing email generated by the Email Engine.
A reply from the Email Engine using an XML template
Observe how the query results of this email are displayed in XML format. If your outgoing mailbox is configured to include an HTML header, the resulting email (combining an HTML header template with an XML result template) would no longer be displayed in purely XML format.