I am able to save pdf files from a saved search - ...
# suitescript
m
I am able to save pdf files from a saved search - for each order, there is a pdf file stored in the file cabinet. Is it possible to send a single email with these files as attachments? How may we do this?
Copy code
const folder_id = 801869;
var file_obj = file.load({
    id: file_ref_id
});
I can add a single file, but how can I add multiple files?
s
the attachments parameter for email.send can take an array of Files, so as long as you can load multiple files, just add them into the same array and you can send them all at once. Note that there is a 10 file attachment limit, though.
z
You can also make one PDF from multiple PDF's. I've done that in the past.
m
Thanks, the 10 file attachment could be a problem. @Zack - able to point me in the direction of being able to create one PDF from multiple PDFs?
z
createPDFset.js.txt
@mg2017 Here’s a quick example. You will need to add the logic to get the ID’s of the PDFs. You can generate them as you go or pull from the file cabinet. Then you just keep adding them to the PDF set with line 40 there.