FME Version
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. The following four articles will demonstrate how to send emails through the FME Server. This tutorial will review how to set up a topic and an email subscriber. A topic is created to receive a notification and a subscription is used to send an email once the notification has been received.
Prerequisites
- FME Server 2016 or later installed
- Access to an SMTP server (a Gmail account works)
Step-by-step Instructions
Creating the topic
FME Server can be set up to send emails. The first step is to set up a topic. Since a topic is just a named “channel”, all this involves is giving the topic a name and description.
- From the FME Server homepage, click Notifications > Topics
- Once, on the Topics page click New
- Give the topic a name (we will use SEND_EMAIL), and optionally a description. Then click OK.
- The topic will show up in the list of topics
Creating the email subscription
In order for notifications published to the topic to have an effect, there must be a subscriber. We will be using an email subscriber.
- Go to Subscriptions
- Once, on the Subscriptions page, click New.
- Set up the email subscriber as demonstrated in the photo below. Tip: To auto-populate, some fields for common SMTP servers, click Load Template.
- Name: Email
- Protocol: Email
- Topics Subscribed To: SEND_EMAIL
- SMTP Server: smtp.gmail.com
- SMTP Server Port: 465
- SMTP Account: Your Gmail Account
- SMTP Password: Your Gmail Password
- Connection Security: SSL/TLS
- Email From: Your Gmail Account
- Email Subject: Zip File
- Email Format: Text
The settings shown are for Gmail, but any SMTP server can be used. Gmail does not allow you to set a from address different than the login account, but this is possible with some other service providers.
Also, if you use a gmail account, you will likely need to create an app-specific password for FME Server or allow less secure apps to access your Gmail account as outline in this article.
Testing the configuration
- Start topic monitoring by going to Notifications > Topic Monitoring then select SEND_EMAIL as the topic. Leave this window open.
- In a new tab, go to Notifications > Topics > SEND_EMAIL and clicking the 'Test Topic' button.
- You can manually send the following JSON into the topic by entering the JSON (found below) in the text box under Data to Send and click OK.
{ "email_to" : "foo@bar.com", "email_cc" : "", "email_from" : "foo@baz.com", "email_replyto" : "", "email_subject" : "Test Email", "subscriber_content" : "Hi, this is your FME Server" } - Switch back to the Topic Monitoring tab and the SEND_EMAIL topic should have displayed the message.
Conclusion
In this part of the tutorial, we have set up a topic and a subscriber, and sent a test email. In the next section, we will create a workspace which will send an email when it is run.
Comments
0 comments
Please sign in to leave a comment.