6 Replies Latest reply on May 20, 2012 6:48 PM by brianquillin

    How to Send Multiple Emails of foundset

    user14040

      Title

      How to Send Multiple Emails of foundset

      Post

      Hi

       

      I have a script that finds service contracts due and i created a layout that list equipment for each person, that part works great but when I try to send a email to the people on the list it only sents emails of the first record.

       

      What I want to do is after the script finds the list of contracts due send a email to each person that belongs to the equipment, is this possible?

       

      Example:

      search finds 2 records 

      John Doe has 2 pieces of equipment [which are listed in a portal]

      Jane Doe has 3 pieces of equipment [which are listed in a portal]

      I want to be able to send a PDF email to each person with their equipment only.

       

      The email works if I send it separately but if I have a large customer list that the contract ends. going through all of them individually wont work.

       

      any suggestions?

       

      Thanks

        • 1. Re: How to Send Multiple Emails of foundset
          philmodjunk

          FileMaker can't email data exactly as shown on a layout directly in the body of your email. Thus, you have to come at this another way.

          Option 1:

          Use save as PDF to save a PDF of your layout that lists the person's equipment in a portal (or better yet, use a list view layout based on the portal's table so that you can't have an issue with more portal records than will fit in the portal). Attach this PDF file to the email and send it.

          Option 2:

          Set up a calculation for the email body that combines the data from the parent record with the use of the List function to produce a list of the data that appears in your portal. This can be a pretty complex calculation in some cases.

          Here's how to use the List function to pull all the data from the related records into the body of your email.

          Identify the fields in the portal's table that you want to list for each related record.

          Define a calculation field, cPortalRow, with an expression like this:

          Field 1 & Chr (9 ) & Field 2 & Chr (9) ....

          Where you specify your portal row fields in place of Field 1, Field 2, etc. Chr (9 ) returns the tab character so this puts a single tab character between each fields value.

          Then, in the email body, You can use List ( RelatedTable::cPortalRow ) and it will list all rows of data from your portal. Keep in mind that this approach does not always work well if the amount of data in each field can vary a lot. (Some data may appear in the wrong column in those cases.)

          Option 3

          Investigate Email Plugsins for FileMaker. There are a number of options out there and several offer formatting options not available via FileMaker's built in Send Mail step that produces only plain text emails.

          • 2. Re: How to Send Multiple Emails of foundset
            user14040

            Thanks

             

            This is what I am trying; Using FMGO

             

            I have a script that finds a list of customers, when I press the email button the email pops up with John Doe's equipment when I send the email out,  then it goes to next step in the script [go to next record] which is Jane Doe's equipment list, this is where I am stuck, how do I get it to go to the next record and sent the email by itself and then after the end of the foundset exit script?

             

            Script finds two customers sends email to the two customers in the found set then exit the script.

             

            Thanks

            • 3. Re: How to Send Multiple Emails of foundset
              philmodjunk

              You must first use Save As PDF to create the PDF of the report, then send mail can attach the PDF and send the email.

              Here's a thread on how to to use save as PDF in a script: Found Sets to PDF with unique file names

              The info in this part of the forum is focused on using FileMaker Pro, you may want to research this question in the FM GO section of this forum to get assistance specific to that application.

              • 4. Re: How to Send Multiple Emails of foundset
                brianquillin

                Larry, 

                Would you mind sharing your script for sending out your PDFs to your entire customer list?  I have a similar situation in which I want to create a script to send out invoices (already generated as PDFs) to my entire customer base with one button.

                Thanks in advance...

                • 5. Re: How to Send Multiple Emails of foundset
                  user14040

                  Hi

                  See image attached

                  You can remove Perform Script - it is a script i use to omit records

                  You can also remove insert text

                  • 6. Re: How to Send Multiple Emails of foundset
                    brianquillin

                    Thanks very much... very helpful...

                    I like the Custom Dialog there... I may add that to mine also...

                    I'll look over it more in depth tomorrow and may have a few questions...

                    MUCH APPRECIATED!

                    Thanks again...