Send sales order pdf as attachment in deluge

Send sales order pdf as attachment in deluge

I have tried the various deluge docs examples but none seem to work, obviously using salesorder attributes.
Help please ;-)

record_id = invoice_details[ID!= 0].ID;
 sendmail  
 [  
    from: zoho.adminuserid  
    to: input.customer_email  
    subject: "New packing sheet for"  + salesorder_id
    message: "Attached....."
    Attachments :template: Medical_Invoice: invoice_details record_id as PDF   // from deluge example
 ]