Send Emails with Attachments From FME Flow Automations

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2023.0

Introduction

Welcome to the final tutorial of the Getting Started with FME Flow (formerly FME Server) series. In this tutorial, refine the automation from the previous tutorial to email an attachment to a user, each time the schedule initiates the workspace. 
 

Step-by-Step Instructions

An External Action will be used to send an email from the automation that has been set up in the previous article. The email will include the Excel spreadsheet of AddressesToNotify as an attachment.

1. Complete the Previous Tutorial
Before working through this tutorial, please complete the Schedule a Workspace to Run with FME Flow Automations tutorial to build the automation. Optionally, you can download and import the starting project, please see the documentation for instructions. Note that the if you are importing the project as a non-admin user you will need to have an admin grant permissions to the project and contents before you can proceed.

2. Open Automation
Log into FME Flow and open the Schedule Addresses to Notify automation that was created in the previous tutorial
StartingAutomation.png
 
3. Add an External Action
If continuing from the previous tutorial, stop the automation first before editing. 
StopAutomation.png

Now let’s hide the Next Action guides to clean up the canvas, and practice manually adding components. To do this, go to Menu, then select Hide Guides. 
HideGuides.png

With the guides hidden, let’s manually add an external action. Click on the plus sign (+)  in the bottom left corner to open the menu (1). Click External Action to select it (2). Now click anywhere on the automation canvas to place it. 
ExternalAction.png


To connect the external action to the workflow, click on the Success output port (checkmark) on the Address To Notify run workspace component and click and drag to the External Action component input port. Tidy up the canvas (if desired) by moving the components in-line, similar to FME Workbench. 
Connect.png

4. Set Up Email
Double-click on the External Action component to open the parameters. In the External Action Details dialog, change the Action to Email (send). After selecting the action type, more options will appear. 
SelectSend.png

To send an email from FME Flow, you will need access to an SMTP email account. FME Flow comes with common SMTP templates such as Gmail, Outlook, etc. Gmail will be demonstrated in this tutorial. If your email provider is not listed, you can manually enter in the SMTP Server and Port. 

Click on the Load Template button and select Gmail; this will auto-populate the SMTP Server and Port fields. 
LoadTemplate.png

Next, enter your SMTP Account and Password, as well as set the Connection Security. Typically SSL/TLS is the default, but you may need to contact your email administrator or view your email properties to determine the security type.  
Credentials.png

Then set the Email To and Email From. The Email From field will be the same as the SMTP account email. You can send the email to the same email as the SMTP email for testing purposes.  Now for the Email Subject, set it to:

New Addresses To Notify

EmailTo.png

Next, for the Email Attachment, click the ellipsis to open the file browser. Navigate to Data > Flow Training > AddressesToNotify_updated.xlsx, then click OK. 
EmailAttachment.png

In the Email Body enter:

See attached file for new addresses to notify for water service.


Once the parameters are set, click Validate (1) to ensure that the email credentials are correct. A Valid message will appear at the top under Load Template (2). After validating, click Apply (3). 
Validate.png
 
5. Start and Trigger Automation
Click Start Automation. With the automation running, so we don’t have to wait until tomorrow to see if the email works, we can trigger the automation to run now. Open the FME Flow Schedule component and click Trigger to trigger the schedule. 
Trigger.png


6. Review Email
Open up the email account that was set up in the Email To field. Confirm that an email was received with the attached AddressesToNotify_updated.xlsx spreadsheet. 
EmailConfirmation.png

 

Continue Your FME Journey  

 

Interested in exploring another practical example similar to this tutorial?

 

Want to continue learning FME Flow basics?

  • The FME Academy is a guided, on-demand way to learn the entire FME Platform, and it's FREE! 

 

Interested in data integration and workspace authoring?

 

Have a specific question?

Data Attribution 

The data used here originates from data made available by the City of Surrey, British Columbia. It contains information licensed under the Open Government License - Surrey. 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.