Send mail (HTML) containing list of files from a Switch job

Post Reply
User avatar
magnussandstrom
Advanced member
Posts: 342
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Send mail (HTML) containing list of files from a Switch job

Post by magnussandstrom »

I would like to send an email to that lists files and folders in a Switch job, like this:

Subject: New Switch job added

Files:
FileA.pdf (5 pages, 210x297 mm) - 565 kb
FileB.zip - 4.5 MB
FolderA (32 files) - 354 MB
FolderB (2 files) - 2 MB


I only want to list the files and folders in the "root", not subfolders. I've been experimenting with [Job.NestedName] but got stucked. Any suggestions how to achieve the above?
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Send mail (HTML) containing list of files from a Switch job

Post by freddyp »

Have a look at the "Filetypes Counter" app from the "Folder apps" bundle. It has powerful features for listing different file types at different subfolder levels and putting all that into an XML dataset. I have not tried it, but I feel confident it is possible to do what you need with that app.
User avatar
magnussandstrom
Advanced member
Posts: 342
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Send mail (HTML) containing list of files from a Switch job

Post by magnussandstrom »

Tnx Freddy, I tried 'Filetyps Counter' but did not get what I need. Now I'm trying to do this with 'Create file from template' app, wish me good luck! :D
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Send mail (HTML) containing list of files from a Switch job

Post by freddyp »

I got it to work. Here is the setup.

"Filetypes counter" with "Root level only" and "File types" defined as as a file type you never receive. The reason for choosing a file type you never receive is because "Filetypes counter" will list all the other file types in the XML under the node "/filetypes/others".

In the Metadata you choose TextIndexed, in "Build location path" you choose "XPath expression" and the XPath is /filetypes/others/item/name. You can then combine them using "Prefix - Suffix" (<li> and </li> if you want to have the files as list items in a mail template).
User avatar
magnussandstrom
Advanced member
Posts: 342
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Send mail (HTML) containing list of files from a Switch job

Post by magnussandstrom »

Thanks for the detailed explanation Freddy! Unfortunatly I cannot load the dataset, I get this error. I have tried with many different Switch jobs/files. If I choose JSON I can load the dataset. Any ideas?
xmlerror.png
xmlerror.png (156.57 KiB) Viewed 1150 times
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Send mail (HTML) containing list of files from a Switch job

Post by freddyp »

What version of Folder apps are you using? And what are the exact values of the properties?
User avatar
magnussandstrom
Advanced member
Posts: 342
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Send mail (HTML) containing list of files from a Switch job

Post by magnussandstrom »

freddyp wrote: Wed Nov 23, 2022 10:43 pm What version of Folder apps are you using? And what are the exact values of the properties?
Folderapps 4.0
5BF344AB-9972-4D46-8851-646E20F36C4F.jpeg
5BF344AB-9972-4D46-8851-646E20F36C4F.jpeg (126.15 KiB) Viewed 1115 times
User avatar
magnussandstrom
Advanced member
Posts: 342
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Send mail (HTML) containing list of files from a Switch job

Post by magnussandstrom »

I again, when I changed fileformat from .pm5 to .ps the XML works!
Post Reply