Attach PDF (no crystal) through code to Email Workflow Event type

SUGGESTED

Hello,

Prior validating payment on Bank website, we need to submit Invoices in PDF.

We would like to avoid send them manually.

  • On X3, we have a folder PIH for Purchase Invoice with all PDF inside named NUM.PDF (Invoice number).
  • In GESPAY (payment), we pick several Purchase Invoices NUM, line by line for 1 payment

We would like to Call a script upon Event (Creation, Button) in GESPAY : 

  • To send the different lines of NUM.PDF by email : 1 email with 1 PDF per line. I don't success
  • 1 payment with 5 invoices lines = 5 emails (Each email 1 PDF)

**

I read different articles on meladx, sendmail, filename, gfilpath, tmp folder. I am lost how to proceed.

I know how to send a Print by email through code with gfilpath.

But I am missing something to send an existing PDF (already on server not a print) by email through code. I got empty PDF files.

If any help would appreciate.