PhixFlow Help

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Sometimes it is necessary to read data into PhixFlow streams from an email account. For example, if orders are always sent to a specified email address in the same format, it can be an easy way to automate their entry into a database or process them.

To do this, you will need to:

  1. Configure an email polling service.
  2. Configure a file collector to gather details of the email message (the body) and any attached files.

Set up service to poll an email account for new messages

Full details for this configuration can be found in emailAccount, but in this article we will cover some common examples.

Step-by-step guide

  1. Click on AdminManage Email Accounts
  2. Add details for a new account - see examples below for POP3 and IMAP; to make this an inbound account, don't tick the Outbound box
  3. Click Test Configuration to ensure the settings are correct
  4. Tick the Enabled box, then save any changes

Example Settings using POP3

With POP3 just the main Inbox is polled for messages 

Example Settings using IMAP / Office 365

With the IMAP protocol, a subfolder can be specified, as in the example below. But if you leave Folder blank, emails will be read directory from the Inbox.

 

Set up file collector to load email messages and/or attachments

Emails will be collected from the email account you have set up, and stored on the PhixFlow server. From this store, you can read these in using a file collector.

Full details for this configuration and found in fileCollector, but in this article we will go through a typical set up which should cover most cases.

The file collector will need to have the following settings (see also the screen shot below):

FieldValue
Source TypeManaged File
File TypeThe type of the attached file, or for reading the email message itself (the body), probably CSV
File Location StrategyAll Files in Folder
Tag

If a tag is being set (see below), the tag name surrounded by double quotes. E.g.:

"accdataemail"

If a tag is not being set:

"default"
Input Directory Expr.
"in"
Directory Pattern Expression
".*"
File Pattern Expression

A pattern to match attached files, e.g. to find attached files with names like AccData-20170426.xlsx:

"AccData.*xlsx"

or if you want to read in the email messages (body) this will be just

"body.txt"
Archive Directory Expression
"archive"

Setting a tag

You can set a tag for the emails by including

#tagValue

in the subject line of incoming emails. Note that the resulting tag you use in the file collector will be all in lower case. For example, if incoming emails have a subject line like

PhixFlow input file accounts 20170426 #accDataEmail

then use the tag

"accdataemail"

in your file collector configuration.

You don't need to know this to complete the configuration of the file collector, but sometimes you might find it helpful to be able to find the files delivered by the email polling service.

In system configuration you will have, under the tab System Directories, a setting File Upload Directory. For example:

/opt/phixflow/data/upload

If you have not specified a tag in the subject line of your incoming emails, files will appear in directories:

/opt/phixflow/data/upload/default/in/[date]/[long ID]

E.g.

/opt/phixflow/data/upload/default/in/20170426/ab5dcb71868e47c484d6aa78430393d6

If you have specified a tag in the subject line of the emails, files will appear in directories:

/opt/phixflow/data/upload/[tag]/in/[date]/[long ID]

E.g. with the tag "accdataemail"

/opt/phixflow/data/upload/accdataemail/in/20170426/eebb98c20ce04246b0cee073a510ccde

Archiving

If you set an archive directory, your files will be moved once they have been read in by the file collector. This will be to:

[file upload directory]/[tag]/[archive dir]/[date]/[long ID]

E.g. if you set the archive directory to "archive" (as in the examples above), your files will be moved to directories like:

/opt/phixflow/data/upload/default/archive/20170426/6904c5192d5944bd919d4eee99bc0237

or, if you are using the tag "accdataemail":

/opt/phixflow/data/upload/accdataemail/archive/20170426/6904c5192d5944bd919d4eee99bc0237


  • No labels