How To Use Email Source Object in a Report Model

Astera ReportMiner offers the capability of working with Email Source object to retrieve data from emails.

This article discusses the steps required to watch any email folder for incoming emails, and then processing the incoming email attachments through a report model.

1. Open a new dataflow by clicking on the Create new Dataflow icon just below the menu bar.

1-create-a-new-dataflow

2. Drag the Email Source object from Toolbox > Sources > Email Source and drop it onto the designer.

2-email-source-object

3. Right-click on the Email source object and select Properties from the context menu. This will open the Properties window on your screen.

03-properties

4. The first screen is be the Email Connection screen. Here, you will have to specify the connection details. You can use the Recent menu to connect to any recently used email sources.

Click Next and go to the next screen.

04-email-connection

Connection Info

URL - here, you have to specify the URL of the mail server which you want to connect to.

Login Name - here, you have to specify your email address.

Password - here, you have to specify your password.

Port - here, you have to specify the port number which your server will use for communication.

Timeout - here, you can specify the time in seconds after which ReportMiner will cease attempts to establishing the connection.

Retries - here, you can specify the number of times you want to retry establishing the connection after failure.

Require SSL - Secure Socket Layer (SSL) secures the communication that takes place between the sender and receiver with strong encryption.

Protocol - here, you can select the type of protocol through which you want the communication to be performed.

Authentication Mode - here, you can select the internal mechanism of handshaking when the email is sent out.

Note: IMAP and POP3 are the two most commonly used Internet mail protocols for retrieving emails. While the POP3 protocol assumes that your email is being accessed only from one application, IMAP allows simultaneous access by multiple clients.

Connection logging

Log Level - here, you can specify the type of log you want in diagnostic file for debugging purpose

5. The next screen is the Email Source Properties screen. There are two important options on this screen:

  1. Download Attachment Options
  2. Email Reading Options

05-download-attachment

Check the Download Attachments box if you want to download the contents of your email. Specify the directory where you want to save the email attachments, in the space next to Directory.

7-attachments-download

The second part of the Email Source Properties screen has the email reading options that you can work with to configure various settings.

8-email-read-options

Read Unread Only – check the option if you want to process the unread emails only.

Mark Email As Read – check the option if you want to mark the processed emails as read.

Folder – you can select the specific folder to watch in your email from the drop-down list.

9-filters

Filters - You can apply various filters to only process specific emails in the folder.

From Filter - filters out emails based on the sender’s email address

Subject Filter - filters out emails based on the text of the subject line

Body Filter - filters out emails based on the body text

After you have configured the properties for the Email Source object, the next step is to provide the path from the Email Source object to the report model. This is the path where the email attachments will be saved so that the report model can retrieve those attachments in the next step.

6. Drag and drop the Report Source object from the toolbox on to the dataflow designer.

10-report-source

7. Right-click on the header of Report Source object and select Properties.

Here, specify the File Path for the Report Model. Leave the file path next to Report Model Location empty because we are going to map the file path externally from the Email Source object.

11-report-model

8. To pass the File Path from Email Source object to the Report Source, right-click on the Report Source option and select Transformation. This will turn the Report Source object into a transformation object and you will be able to pass the report source file path as input to it.

Note: Transformation objects have a distinctive purple color header.

12-transformation

9. Map the LocalFilePath field from the Email source object to the FilePath data field in the Report Source object.

13-local-file-apth

This concludes extracting the reports in your email folders and processing them through a report model in Astera ReportMiner.