```const pdf_file = render.pickingTicket({ ent...
# suitescript
m
Copy code
const pdf_file = render.pickingTicket({
    entityId: parseInt(so_id),
    printMode: render.PrintMode.PDF
});
log.debug({title: 'PDF File ID', details: pdf_file});
//Store PDF in new folder
pdf_file.folder = 1737513; 
pdf_file.name = company_name_lookup.entityid + '_' + pdf_file.name;
const file_id = pdf_file.save();
I am storing the delivery note of a SO in the file cabinet. I am wanting to attach this file and use it in an email. How can I achieve this? Even better, if I don't need to store the file in file cabinet, but can use it directly in the email.
m
N/email module can be used to create and send an email in SS. The email.send() function has an "attachments" option parameter you should be able to use to attach the file.
m
so the file_id can simply be passed as an attachment?
m
Believe it needs to be the file object
Here's the example snippet from the SS docs
👍 1
m
Thanks, this worked.