7 Replies Latest reply on Oct 9, 2014 3:28 PM by philmodjunk

    E-mail Notification

    ChrisCameron

      Title

      E-mail Notification

      Post

      I am somewhat new to Filemaker Pro. I am working on a Vehicle Maintenance database. The customer would like to have email notifications sent to their email a week before an inspection is due. I have all of the fields set-up and even have a script in place to automatically detect the due date by the previous date the inspection was done. I have a report set-up that they currently run monthly to see all of the inspections that are due that month but I am not sure if email notification can be set-up instead of or in addition to running the report. Thanks.

        • 1. Re: E-mail Notification
          philmodjunk

          The email can even send the report to them as an attached PDF.

          But step one is to make sure that you can get FileMaker's send mail to work on their system. It will either use their systems email client program (if compatible with FileMaker) or it can use an SMTP mail server to send out the email notifications.

          Try using Send Mail from the File Menu to send an email to yourself. Try this on the client's computer so that you can see if there are any issues on their system.

          Once you can do that manually, the same dialogs can be used to set up the Send Mail script step to send out the email. So at that point it becomes a matter of scheduling the script to take place on a regular basis.

          How you do that can depend on how the database solution is set up. If you are hosting the file from FileMaker Server, a Server schedule can be used to schedule the script and it can use SMTP (a requirement when the script is run "server side") to send out this email.

          But there are also ways to send this out on a regular schedule "client side" and/or from a file not hosted by server.

          • 2. Re: E-mail Notification
            ChrisCameron

             PhilModJunk, Thank you for the explanation. I am using a local installation (Client Side) of FileMaker Pro and was able to manually send a mail message and received it. Any further assistance you could provide as far as to how to dictate script would be appreciated. Anything that I have tried isn't getting the result. Thanks.

            • 3. Re: E-mail Notification
              philmodjunk

              You'll need to share what you have tried in your script to send out the email and explain what "Result" isn't being produced. Is the PDF being produced? Produced but not sent? No email at all is sent? or ?

              To post a script to the forum:

                     
              1. You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
              2.      
              3. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
              4.      
              5. If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
              6.      
              7. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
              • 4. Re: E-mail Notification
                ChrisCameron

                Phil, I searched and found a post where you put a basic script formula. I modified it to reflect my fields and below is a screenshot of the script as I currently have configured. When script is ran. I receive the custom dialog box that reads no records found. Thanks.

                • 5. Re: E-mail Notification
                  philmodjunk

                  The basic syntax is correct. I suspect that your calculated criterion: Get ( CurrentDate ) + 30 simply doesn't match to any records.

                  Make sure that "Next Due" is either a field of type Date or a calculation field with "Date" as its specified result type.

                  Make sure that your current layout (The layout that is visible when the script is run) is a layout based on Inspections not some other table or table occurrence.

                  Note that your criterion only finds records where the date is exactly 30 days into the future. Records with a date even one day different are not found.

                  You may want to use an inequality operator such as: "<" & Get ( CurrentDate ) + 30 to find all records with a due date that is 30 from today or earlier. Once that works,  second criterion in it's own set field might be used to check a status field to omit records where this email has already been sent out. after sending out the email, the script can modify the value in this field so that the record is not found again. (This way, you don't have to be 100% consistent in preforming the script once a day.)

                  • 6. Re: E-mail Notification
                    ChrisCameron

                    I have added the inequality operator and I am now getting records but they aren't showing any of that information in the email. I would like the Vehicle Name and Due Date included along with the type of Inspection due all located in the same portal row in the email that is being generated. Any suggestions?

                    • 7. Re: E-mail Notification
                      philmodjunk

                      I'd need to see the details of your Send Mail step.

                      and your reference to a row in a portal suggests a possible misunderstanding. A scripted find finds records in the layout's table, not the related records of a portal. If you specify data in a field from a related table, the scripted find finds all layout records that have at least one related record that matches the specified criteria. Then your layout returns to browse mode and all related records appear in the portal--not just the ones matching your search criteria.