Transact

  1. Home
  2. Transact
  3. Features and Functions
  4. Administrator Role and Features
  5. Importing Documents
  6. E-mail Configuration
  7. Access Email Headers in Batch XML

Access Email Headers in Batch XML

Introduction

Ephesoft Transact enables a developer or administrator to access the email headers for the batches that use the Mail Import function. This information is available in the batch.xml file for the batch being processed.

In addition, each page of the batch holds a reference in the batch.xml file that cites the source email from which it came.

This document describes email metadata that can be configured to pass through to the batch.xml schema during the Ephesoft Transact workflow. This document applies to Ephesoft Transact 2019.1 and above.

Email Metadata in the Batch.xml Schema

Ephesoft Transact 2019.1 and later releases support the following email metadata elements in the batch.xml schema. These elements and fields apply for each batch instance that uses email import.

                         Metadata hierarchy

The batch.xml schema contains email metadata in the following hierarchy:

The following table describes the metadata elements available for each batch instance that uses email import:

FieldDescription
BatchSourceThis batch-level element is contained in the batch section of the batch.xml schema.

The BatchSource is located in the batch-level fields of the batch instance.

This element cites Email Import if a document is ingested into the batch instance using email import.

Email This batch-level element of the batch.xml schema contains the individual emails in the batch instance. This section contains several additional elements such as:

  • Email sub-section
  • Protocol
  • Folder
  • Subject
  • Headers
EmailHeadersThis batch-level section of the batch.xml schema contains several additional elements such as:

  • Email
  • Protocol
  • Folder
Folder This email-level element identifies the email folder from which each email was imported, such as inbox.

The following XML sample illustrates the contents of the Protocol and Folder elements:


XML sample

The developer can access the email header information for each email in the batch instance:

  • This information is available when using email import for the batch instance.
  • Each page in the batch instance holds a reference to the email source.
IDThis email-level element appears under the EmailHeaders subsection of the batch instance.

This element cites the unique identifier for each email imported into the batch instance.

Protocol This email-level element is contained in the Email and EmailHeaders elements of the batch.xml schema.

This element identifies the email protocol applicable to each email in the batch instance, such as MAP or POP3.

The following XML sample illustrates the contents of the Protocol and Folder elements:

XML sample

The developer can access the EmailHeaders for the batches executed via the Mail-Import function.

  • This information is available in the batch.xml file for the batch instance.
  • Each page of the batch holds a reference in the batch.xml to the email source.
SourceEmailIDThis page-level element is contained in the Page element of the batch.xml schema.

This element cites the email identities contained in the Email and EmailHeaders elements.

Each page of the batch holds a reference in the batch.xml file that cites the source email from which it came.

The batch.xml schema lists all email IDs for the various emails that come in with document attachments. Typically, this entails one email ID per attached document. However, there may be cases where multiple emails are combined into a single batch. In this case, the element displays all email IDs under the same batch.

Sample Batch.xml Schema for Email Import

The following example illustrates the EmailHeaders segment of a sample batch.xml file:

Samlpe batch.xml file

Configuring Mail Import Properties

The user must adjust settings in the mail-import.properties file to fetch the header information. The file is available in the following location:

  • Ephesoft\Application\WEB-INF\classes\META-INF\dcma-mail-import\mail-import.properties
  • The following content from the properties file illustrates this email header information:
    #Switch to fetch and set headers or not.
    Dcma.mail.headers_swith=ON
    #Headers to fetch from mail, separated by semi-colon. Example: Subject;To;From
    Dcma.mail.required_headers=From;To:Date;Subject

https://ephesoft.com/docs/wp-content/uploads/sites/11/2016/08/word-image-60.png

Sample Settings in mail-import.properties file

  • dcma.mail.headers_switch
    The value of this property decides whether to pull in header information or not. By default, the value is set as ON. The header information is pulled by default.
  • dcma.mail.required_headers
    The value of this property holds the list of headers that needs to be fetched separated by semicolon.
    For example, dcma.mail.required_headers=Subject;To;From.
  • In the above example, only Subject, To, and From headers are available in the batch.xml file.
  • To fetch all the headers from the email, set the value of this property to ALL:
    dcma.mail.required_headers=ALL

By default, the value of this property is set as follows:
From;To;Date;Subject

Sample Email Metadata in the Batch.xml Schema

Using default configurations as an example, this section presents two scenarios to illustrate whether the Email Clubbing switch is set to ON or OFF.

Case 1: Without Email Clubbing

If the Email Clubbing feature is set to OFF, there is only one email per batch.

In this case, there will be headers of only one email in the batch.xml file. Each page of the batch has a reference to that header in the batch.xml file.

The following example illustrates Email Clubbing as disabled or set to OFF. The following example illustrates the email headers schema in the batch.xml file:


 Email headers schema in the batch.xml file

The following figure illustrates this same example of email clubbing set to off:

https://ephesoft.com/docs/wp-content/uploads/sites/11/2016/08/word-image-62.png

Email Clubbing set to OFF

  • Because the Email Clubbing feature is set to OFF, there is only one Email tag.
  • The Email tag contains the headers in the Headers tag where headers are present as a Name and Value pair. The values of the configured headers are available in the batch.xml file as shown above.
  • The Email tag further contains the Id, Subject and Date tags.
  • The Subject and Date work as unique identifier for the mail, that is, to map the email with the mail server.
  • The ID tag maps the email with the pages in the document.
  • Each Page tag of the batch would have a tag SourceEmailID referring to the Id of the email of which it is a part, as shown in the following example:

SourceEmaillD 

https://ephesoft.com/docs/wp-content/uploads/sites/11/2016/08/word-image-64.png

SourceEmailID Element sample

Case 2: With Email Clubbing

When the Email Clubbing feature is enabled with the ON setting, there can be more than one email per batch. In this case, the batch.xml file contains headers of more than one email. The following code sample illustrates this case:

 Multiple emails sample

The following figure illustrates this sample in a graphics image, with headers from more than one email:

https://ephesoft.com/docs/wp-content/uploads/sites/11/2016/08/word-image-66.png

Batch.xml file contains headers of more than one email

Because the Email Clubbing feature is enabled with ON, two emails have been clubbed and the headers of both are available in the batch.xml file.

The pages in the email have their SourceEmailID included in the batch.xml file to cite the email of which they are part.

Was this article helpful to you? Yes No