span8
span4
span8
span4
This article is specific to FME Server 2015.For the latest version of this content please visit:Receiving email,Part 2: Processing email with a workspace.For the FME Server 2014 version of this article please see:Receiving email,Part 2: Processing email with a workspace (2014)
This tutorial is part of the seriesEmail in FME Server (2015)
Previous section: Receiving email,Part 1
Next section: Receiving email,Part 3
The workspace we will be creating will run when an email is sent to FME Server.The workspace will simply log the subject line of the email.This will then be viewable through the FME Server web interface.
The email subscription we will be creating in the next section will run the workspace,and the email will be available as a text file (JSON).
The workspace we create should have a Text File reader.You can specify a sample data file,but it will be replaced by the incoming email.You may wish to download the workspace attached to this tutorial,since the sample email file shows how the incoming JSON will be formatted.
There are two completed workspaces attached,one for SMTP and one for IMAP.
When publishing the workspace,we have to set the topic to which it will be subscribed,and specify which reader will receive the JSON file.
Emails sent to your FME Server should now cause the workspace to run and log the email subject line.
If you need to take different actions based on the subject of the email - perhaps you are accepting files for different projects - you can filter and route emails to different sub-workspaces.This technique works well if you've set up regex-based subject filtering in the previous section.There is another sample workspace attached to this article which demonstrates how to use a TestFilter to route emails with three potential different project names in the subject line (FilterBySubject.fmwt).
To test,simply send an email to the account you configured in the previous section of the tutorial.This will be either the address created on the FME Server if you are using SMTP relaying (such as demoEmailUser@yourFMEServer) or an account on your own mail server if using the IMAP method (such asfmeserver@gmail.com).This should cause the workspace to run,and you can view it in the Job History.If you view the log,the subject line of the email should show up.
You may find that the configuration that you put in place is not working as expected.To help narrow down the problem,you can use FME Server's log files.The diagram below shows how an email flows through components in FME Server and which log files are updated at each point.Check these messages and timestamps in these files to confirm that the email is reaching each component.Note:in the diagram below,"FMEServer\Logs" refers to the FME Server System Share for 2015 and later,while in earlier versions,the logs are in the install directory.
In this part of the tutorial,we created and published a workspace which processes emails.It simply logs the subject line of the email,but in the next part of the tutorial,we will expand it to process email attachments.
Next section
For SMTP the following attributes can be exposed in order to extract more information from the incoming email JSON:
email_publisher_attachment{} email_publisher_content_type{} email_publisher_content{} email_publisher_from email_publisher_to email_publisher_received email_publisher_sent email_publisher_subject fns_topic fns_type For IMAP the following attributes can be exposed in order to extract more information from the incoming email JSON:
imap_publisher_attachment{} imap_publisher_content{} imap_publisher_sent imap_publisher_from imap_publisher_subject imap_publisher_content_type{} imap_publisher_received imap_publisher_to fns_type
Note:the "_publisher_received" attributes are not formatted in FME Date/Time format.Included in the download section above is a workspace that contains an example of how to convert it to the standard format.This should make this information easier to use with other transformers.
Sending email,Part 4: Sending prettier email using HTML (2015)
Sending email,Part 1: Setting up a topic and an email subscriber (2015)
Receiving email,Part 3: Using email attachments (2015)
Sending email,Part 3: Sending an email when a workspace completes (2015)
Receiving email,Part 1: Setting up a topic and an email address (2015)
Sending email,Part 5: Sending an email with attachments (2015)
Sending email,Part 2: Sending an email using the FMEServerNotifier (2015)
Sending email,Part 2: Sending an email using the FMEServerNotifier (2014)
Subscribe,Report and Notify Tutorial - 1.Database-Backed Subscriptions (2014)
© 2019 亚搏在线Safe Software Inc |Legal