Summary

The File Trigger can be used to trigger a job based on the creation or modification of a file. In some cases you may want to e-mail the file(s) that trigger the job.

More Information

Files can be e-mailed using a Notification task as a step in the job. However, the means of sending the trigger files is not obvious.

There is no way for the File Trigger to "tell" the Notification Task which file(s) to e-mail. To e-mail the files that trigger the job, you must provide both the File Trigger and the Notification Task with the same file specification.

For example, if your job is triggered whenever a file is added to the folder "c:\inputfiles", the file specification in your File Trigger would be "C:\inputfiles\*.*". You would then add the same file specification on the Attachments page of the Notification Task. This will cause the Notification Task to attach all files that match the specifications that cause the job to trigger.

Note that this solution may be inexact, as the Notification Task will send all files that match the specifications and cannot identify which specific file caused the job to trigger. Therefore, if the trigger file from the previous run is still in the folder, it will get sent along with the new file that actually caused the job to trigger.

Capturing the Files

If you wish to "capture" the trigger files in addition to e-mailing them, you can use either the "Capture the file" option in the File Trigger or the "Save these files in the job history" option on the Attachments page of the Notification task.  

If you want to delete the trigger files in addition to capturing them, however, do not use the capture and deletion options in the File Trigger, as this will cause the file(s) to be deleted before the Notification Task has a chance to send them. Instead, use the capture and delete options when you specify the attachments for the notification task.