Creating result templates for outgoing email


You can use XML when creating templates for outgoing emails. The following example uses XML format when creating a result template. The results from a query are returned in XML.

To use XML with outgoing email

  1. 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$$#).

    Tip

    You can easily validate your XML file by displaying it in a browser.

  2. 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.
  3. 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 Doe

    This 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
    e-XML-templ.gif
    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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*