OL Learn

Workflow Email - Dynamic Attachments

Using 2019.1 Workflow only.

Need to create a process that collects multiple files from a folder and send an email. There will not be a template or data mapper involved. I will not know what the file names will be, just the directory name and the range of how may files to expect. Files are required to remain as separate attachments in a single email.

Because the email attachment allows variables, I assumed that I can use them, but the plugin can’t seem to locate the file if populated with a variable.

Set the variables based on Folder Listing
I statically added one of the files to see if it could pickup and email the file
Notice that the file name appears to be the same between the first dynamically created value and the last which is a static value.

Just chiming in before leaving work. First (edit, made a fool of myself)

Another thing that might be useful to you that I do with email attachments. I just specify that the plugin must attach all PDF’s in a folder by using e.g. C:\out\*.pdf.

Not sure about having each file attached to the email without zipping them. Would actually like to know that. (I now know due to the below… how embarrassing)

Please note that I am yet to upgrade to 2019.1, so not sure if anything changed.


The problem was trying to add the sPath and XML in the same Set Job Info.


The checkbox relates to the zip mode setting on each file.

In reality there will be different file types, but if they were all PDF files then the wildcard idea is great.

Oh my G*d!!. How did I not see that all these years! I’m ashamed but also amused LOL

I’ve been testing this a bit here with both the old Send Email and the new Secure Email Output and wasn’t able to reproduce the behavior until I noticed one minor little thing.

In the Folder Listing that you appear to be doing to get the path/filenames, the “folder” path that’s returned by the Folder Listing plugin appears to have some extra spaces at the end of it. See below.


If you don’t check Trim Selection, those spaces are impacting Workflow’s ability to locate the file, despite the logs appearing fine.

With that off, my workflow fails in the same way as yours. With it on, however, it works like a charm.

Okay this makes sense.


Can I please have clear explanation how this is achieved?

I want to send all files in a directory as an email attachment.

thanks and appreciate any input.

I actually I have figured this out :slight_smile: Judging by the look of the screenshot.