3 Replies Latest reply on Jun 11, 2014 8:13 AM by philmodjunk

    Automated "send mail" with individual PDF's (scripting problem)

    FemkeMaes

      Title

      Automated "send mail" with individual PDF's (scripting problem)

      Post

           Hello all, I have a database in which I created invoices ( layout). I need to e-mail all the individual invoicees their own invoice as a PDF. I have all the e-mailadresses.

           With 'send mail' this works, but I have to send out more than 1.000 invoices so I was hoping this could be automated. I am unsure on how to create the PDF's. This thread http://forums.filemaker.com/posts/23033c1f7a was usefull, but somehow does not attach the PDF's...Also, I assume that it works for one record only and I need to loop through a lot more.

           What I have done:

      Go to layout [Invoices]

      Go to record [First]

      LOOP

          Set Variable [$pdfnaam; Value: invoices::number & ".pdf"]
               Save Records as PDF [Restore; No dialog; "$pdfnaam"; Record being browsed]
               Send Mail [To: invoices::email; Subject: "some text"; Message "some message"; "$pdfnaam"]
               Go to Record [next, close after last]

      END LOOP

           The e-mail is sent (I did a trial run) but no PDF attachment is sent with it. Can you help me figure out what I did wrong (and if this is indeed the method to do it?)

           Thanks, Femke