0

Send email with all attachments

I need to send a packing list and shipipng labels to our warehouse.

I have a button that creates the packing list and saves it to attachments as a PDF. I then upload the shipping labels manually.

How can I then create a button to send an email with all attachments? Using files(this) returns an error. And the file names + numbers will always vary (sometimes 1 shipipng document, sometimes 3, plus the packing list)

1 reply

null
    • SECOS Group
    • quartz_cap
    • 4 yrs ago
    • Reported - view

    Got it working! Must of had a typo initially. Instead of files(this) I had file(this)

     

    Only issue now is that when I open the PDf in the email it tries to print straight away. Could be an error on my emails end though so will explore that.

     

    For others wondering, the code is:

     

    let myEmail := userEmail();
    sendEmail({
    from: myEmail,
    to: "email@email.com",
    subject: "Subject here",
    text: "Please see attached packing list and shipping labels for" + " " + Customer + ", " + "Order Ref:" + " " + 'Order Ref',
    attachments: files(this)
    })

Content aside

  • 4 yrs agoLast active
  • 1Replies
  • 1433Views