Introduction
When a job is run asynchronously (i.e., you provide an email address) via a data download or a job submitter, a notification is sent upon completion. The standard workflow is to request data, providing an email address. Once the data is processed, a download link for the results is emailed to the requester.
FME Flow has four default topics used by the Job Submitter service and Data Download service:
- DATADOWNLOAD_ASYNC_JOB_SUCCESS
- DATADOWNLOAD_ASYNC_JOB_FAILURE
- JOBSUBMITTER_ASYNC_JOB_SUCCESS
- JOBSUBMITTER_ASYNC_JOB_FAILURE
There are also default email subscriptions to these topics, which can be configured to use your SMTP server:
- DataDownload_Email_JobSuccess
- DataDownload_Email_JobFailure
- JobSubmitter_Email_JobSuccess
- JobSubmitter_Email_JobFailure
Step-by-step Instructions
Use the "Manage Notifications" button on the FME Flow home page, and open the Topic Monitoring tab. Set the Topics to Monitor to: DATADOWNLOAD_ASYNC_JOB_SUCCESS.
Open a new tab or window, and configure austinApartments.fmw in the Samples repository (Manage > Workspaces > Samples) with the Data Download service, and supply the “Email results to” input box with an email address:
When you run it, you will see the default notification content in the Monitoring tool.
Once you have verified the notification has been received successfully, you can configure the notification subscription DataDownload_Email_JobSuccess to send email. Open the Subscriptions (Manage > Notifications > Subscriptions) and select the "DataDownload_Email_JobSuccess" Subscription. You'll see that the Topics Subscribed to is set to DATADOWNLOAD_ASYNC_JOB_SUCCESS. Select "email" as the protocol, and make the necessary changes to your protocol settings.
You will need to supply credentials for an SMTP server, or use the configuration parameters for a Gmail SMTP server. If using 2-factor authentication with Google, you will also need to generate an app password and replace the SMTP password with this 16-digit app password code.
You can modify the message content in the Email Template input box. Any of the keywords listed in the notification message (id, downloadURL, etc.) can be used in the email template by surrounding each keyword with curly braces ({ }). Please see the Email Template Language documentation for further details on configuring email content.