Setting Up a Flow to Handle Email Events (POP3)
  • 26 Jan 2021
  • 2 Minutes to read
  • Dark
    Light

Setting Up a Flow to Handle Email Events (POP3)

  • Dark
    Light

Article Summary

Overview

An Email Event is a change in state on an Email Server, such as when the Server receives or relays an email. The system can be configured to handle email events for a Post Office Protocol (POP3) server or an Internet Message Access Protocol (IMAP) Server. 

A POP3 Server requires that clients download emails from the Server to access them. An IMAP Server allows a client to access emails directly on the Server. 

The following document demonstrates how to set up and enable a Schedule Flow for use as an Email handler for a POP3 Server. 

Example

  1. Navigate to the System > Jobs and Events > Scheduled Jobs and click the NEW SCHEDULED FLOW button in the top Action bar.
  2. Provide a Scheduled Job Name then click PICK SCHEDULED FLOW.
    1. Click CREATE, then Flow, then provide a Name and select CREATE once more. 
  3. Attach a Get Headers step from the EMAIL > POP Folder in the Toolbox tab, to the Start step. 
  4. Navigate to the Get Headers step's Properties tab.
    1. Map the desired number of Email Header data for the Flow to check under Count
    2. Constant map the Email Server's info; the login Account's Username and Password, the Server's Name, and the Portnumber.
      This example utilizes the POP settings for a Gmail account. To set up POP with Gmail or to locate POP settings for a Gmail Server see:
      Gmail Pop Settings.

  5. Attach a ForEach Step from the ITERATION category in the Toolbox tab, to the Received path of the Get Headers step.
  6. Select the ForEach Step to navigate to its Properties tab.
    1. Select From Flow map Headers to INPUTS > Collection
      Mapping the Collection Input will automatically adjust the Type under DATA, to its corresponding Data Type. This will allow the ForEach Step to pass EmailHeader data through the Flow. 

  7. Attach the Done path to the End step, then attach a Get Email step from EMAIL > POP.
  8. From the Properties tab of the Get Email step, configure the INPUTS to match the Server settings of the Get Headers step. 
    1. Select From Flow Headers. All UniqueId.First to Unique Id
  9. Connect the Not Found path to the End step. 
  10. Attach the Found path to any desired Email processing Flows running as an Asynchronous Sub Flow
    When using an Email processing Sub Flow, define the Output Message data from the Get Email step as the Input for the Sub Flow, to allow the Flow to transfer all information through the Sub Flow and back. 

  11. Save the Flow and Debug to test its function. 
  12. Close the Flow via X.
  13. Back in the New Scheduled Flow panel, scroll down to Schedule Configuration > Calendar.
    1. Select Time Span Schedule from the dropdown menu.
    2. Navigate to Timespan, then set it to 0 Seconds, 0 Minutes, 1 Hour, 0 Days, by adjusting the number value in each respective box. 
  14. Click Save. 
    Proper configuration of this example allows the Flow to check for new emails on a POP Server, then process those Emails via process logic in an Async Sub Flow. 

Was this article helpful?