Conditional attachments in sendmail function

Conditional attachments in sendmail function

I would like to have a hand-full of checkboxes that say "Invoice" , "Contract" , "File 1" , "File 2" etc.

And when each of the checkboxes are checked, I would like to add them as Attachments in a sendmail function like so

  1. sendmail
  2.     (
  3.         To       :  input.Client_Name.Email 
  4.         From     :  zoho.adminuserid 
  5.         Subject  :  input.Subject_field 
  6.         Message  :  input.Message 
  7.         Attachments : "all checked boxes"
  8.     )
I tried creating a list with all of the boxes that are checked and inputing that list in the attachments like so

  1. list = {template: Invoice as PDF, file:input.lookup.file_string} 
  2. sendmail
  3. (
  4. -
  5. -
  6. -
  7. Attachments : list
  8. )
But this doesnt work. Any ideas?