7 Replies Latest reply on May 16, 2012 9:40 AM by TSGal

    Sending Multiple Emails From A Foundset



      Sending Multiple Emails From A Foundset


      I posted this question in FM Pro forum but I think it should be here.


      Trying to send multiple emails to defferent customers of their data.




      Script finds customers with contract ending soon it list the following


      John Doe has 2 pieces of equipment

      Jane Doe has 3 pieces of equipment


      I want to be able to send an email to both customers with just one push of a button instead of having to push the button twice.  If I had 50 customers that would not be efficient.


      Right now 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?


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


        • 1. Re: Sending Multiple Emails From A Foundset


          Thank you for your post.

          If you have to press a button to send the mail from your email client, then make sure you check the option "Perform without dialog" in the Send Mail script step.  You will then not be prompted for each message.

          Let me know if you need additional clarification.

          FileMaker, Inc.

          • 2. Re: Sending Multiple Emails From A Foundset

            Thanks for responding to my message.


            What i wanted is for it to go to the next record and email the information, right now it just emails the first record.


            I have a layout that is based on the customer table and a portal that is based on the equipment table and list the equipment for that customer.  I could have 10 different customers that list their equipment.  The script I have emails the equipment list for the first customer but then it stops.  I added [go to next record] in the script and after it sends the email it goes to the next customer but then it stops.


            How do I get it to email the remaining 9 customers without me having to hit the email button again.  If 10 records of customers are list i want to send all 10 records by email not just one record and stop.



            • 3. Re: Sending Multiple Emails From A Foundset


              In your script, make sure you have a Loop construct something similar to:

              Go to Record/Request/Page [ First ]
                 Send Mail [ no dialog ; <all other options> ]
                 Go to Record/Request/Page [ Next ; Exit after last ]
              End Loop


              In essence, we go to the first record of the found set, enter the loop, send an email, go to the next record, and loop back to the beginning of the loop.  When we get to the last record and try to skip to the next record, the script is exited.

              Let me know if you want me to explain this in greater detail.

              FileMaker, Inc.

              • 4. Re: Sending Multiple Emails From A Foundset

                thank worked perfectly



                • 5. Re: Sending Multiple Emails From A Foundset

                  Can you tell me what Im doing wrong, I am using the same script (Picture attached) in another database but it's not emailing correctly from the foundset.


                  What happens is it emails the first record twice then it stops and then goes to the next record.  Using the same script in another solution it works fine.


                  I have two scripts one that searches for what I want to seee in this case everything with "Yes" showing that works fine, the script goes to the layout and shows two records that displays "Yes"


                  I have a email button on teh layout with a script (picture attached) that suppose to send email to each person their own record of information but what it does is send a email of first record then it send the send email with the same information but with the right email address (from the second record).


                  Record 1 - email1@email.com  data1

                  Goto next Record

                  Record 2 - email2@email.com but sent data from record 1

                  loop end

                  script ends and goes to layout displaying Record 2



                  not sure what the problem is



                  • 6. Re: Sending Multiple Emails From A Foundset

                    This is the original script

                    • 7. Re: Sending Multiple Emails From A Foundset

                      Larry Williams:

                      Without seeing the file, it is difficult to determine what is the issue.  However, I do notice that you are only exporting the current record to a PDF file, and then sending that same document to everyone in the loop.  You may want to save the PDF file within the loop so you send a different PDF file to each customer.  Also, since FileMaker Go will not overwrite PDF files, so a new one is created each time and appends an incremental number if the same file named is found.  Therefore, you will have to reference the correct PDF file each time, and I assume that is what the global field is used for.

                      FileMaker, Inc.