KB Article #182255

HOWTO: Sending email notifications when there are no files found to pull

This article demonstrates how to set up an email notification whenever SecureTransport does not find any files to pull from a remote site.


1. Create an Advanced Routing Application


2. Create a blank Route Package Template


3. Go to the account of the user who will execute the pulls

4. Assign the Route Template to the account

Under the Routes tab select the AR Template created in Step 2 and click the Assign Route button. The Create Route Package screen will open. Give the Package a meaningful name, for example "NotificationMail".



5. Create Routes

Under the Specific Settings section create two empty Routes; these are "account-local" and will not affect the server-global Template. The first of the Routes can be named no_files_sent or something meaningful, which will tell us that this Route will be sending the notifications when no files were found by the pull.


For the purpose of this example, create a second Route - send_successfully - which will execute a Send To Partner Step when files were successfully pulled.


Enable the First Matching Route radio button.



It is important that the no_files_pulled Route is on top of the list.


6. Configure the no_files_sent Route

Enable the Expression Language radio button. Click on the question mark to display the example pop-up and select the Wildcard pull example. This condition expression will check if any files have been pulled.


Enable the Notify following e-mails on route triggering checkbox and provide an address where the notifications will be sent. Select the Mail Template which will be used for the notifications.


Example settings:



7. Configure the sent_successfully Route

If you want to send the successfully pulled files to a partner, or do something else with them, you can configure this Route accordingly. If your intention is to simply be notified when no files were pulled, this Route is not needed and should not be created (you can delete it, if you've already created it in step 5).



8. Create Subscription

Under the Subscriptions tab, subscribe the account to the AdvaceRoutingApp created in step 1.



9. Configure the Subscription

Select the Transfer Site used for the pulls.



Select the Route Package created in step 5.



Enable the Execute route when the remote server returns no files radio button.


10. Testing the settings

You need to test two scenarios: when there are no files to be pulled on the source server, and when there are files to be pulled. In both scenarios you can trigger a pull by opening the Subscription and clicking on the Retrieve files now button.



The results of the two tests should be as follows:


When there are no files to be pulled, there should be a log message in the Server Log that an attempt was made to send a notification to the configured email address in step 6.


Note: The SecureTransport instance used in this example did not have a properly configured mail server thus the email sending failed. This should not be the case with your ST instance. If it does fail in your ST instance, then you must review the mail server configuration in ST (Settings → Miscellaneous → SMTP Configuration) and the actual mail server's settings as well.


When there are files to be pulled, there should not be a log message for the email notification in the Server Log and the files should be processed as configured in step 7 (if it was done so).