Sending email, Part 3: Sending an email when a workspace completes

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

  • FME 2018.x

As of FME Server 2019+, this functionality can be completed using FME Server Automations. For more information, please see Send email from Automations. Note that this tutorial series will no longer be updated, if you encounter an error, please contact Safe Support.

 

Introduction

This tutorial is part of the series Email in FME Server. This is the third article in the sending emails series. The previous article demonstrated how to use a workspace to send an email using the FME Server Notifier. This article will demonstrate we how to send an email after a workspace completes. The email can be different depending on whether the workspace succeeded or failed.

 

Prerequisites

  • FME Server 2016 or later installed
  • Access to an SMTP server (a Gmail account works)
  • Part 2 of this tutorial completed

 

Step-by-step Instructions

Creating the workspace

In order to send an email once a job completes, you will need to pre-generate the email which will be sent and supply it as a text file.

  1. Use the workspace created in the previous section, and save a new copy of it.
  2. Delete the FMEServerNotifier.
  3. Add a Text File Writer in its place. The text_line_data attribute of the FMEServerEmailGenerator will connect to the input port of the writer. It is okay to accept the default parameters. It can have an arbitrary path since the path will not be used on FME Server.
  4. Save your workspace as we will be using it in the next tutorial.

Note: If you wish to add/remove the log file attachment from the Data Download and Job Submitter result, see the Key Property ATTACH_TRANSFORMATION_LOG in this documentation.

 

Publishing and running the workspace

The workspace can now be published. For this tutorial, we will be publishing to the Job Submitter service.

  1. Select the Job Submitter service for publication.
  2. Edit its properties, setting “Post to Topic(s) on Success” to SEND_EMAIL, and “Data to Post” to the Text File Writer.send-part3.png
  3. Finish publishing, and run the workspace on FME Server.

You should receive an email with your custom message.

 

Troubleshooting

If you don’t receive an email, you can do the following to troubleshoot:

From the Notifications page in the FME Server web interface, select the Topic Monitoring tab and enable monitoring on the SEND_EMAIL topic. This will show you what content is being received on the topic

If JSON content is being received in the topic, your SMTP settings are probably incorrect. Review them, and try again. For more information about troubleshooting notifications with log files, see About Log Files in FME Server.
 

In addition, ensure that the correct topic was chosen when the workspace was published and that the notification writer was selected.

 

Conclusion

In this part of the tutorial, we’ve configured a workspace to notify a user via email when it completes successfully. This can be useful to notify remote users of the completion of a long-running job, or notify an administrator when a database has been updated.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.