AnsweredAssumed Answered

Time-Dependent Automated Email Script

Question asked by RobMad on Aug 31, 2012
Latest reply on Sep 4, 2012 by philmodjunk

Title

Time-Dependent Automated Email Script

Post

Hi all,

 

I am new to FileMaker and was asked by my company to write a script that will automatically generate an email at midnight for those with appointments in ten days.  I've never written a script before and from what I can learn, it is not the easiest one to start with.  Any help would be appreciated!

Here is what I have:

 

Perform Script [CheckEmail]

Set Error Capture [On]

If (Admin::DateAppointment)-Get(CurrentDate)=10)

     If [Get(FoundCount) = 0]

          Exit Script []

     End if

     Set Error Capture [Off]

     Go to Record/Request/Page [First]

     If {$$MailerType = 2)

          Loop

               Perform Script ["SMTPit_Initialize"]

               If [Trim(Admin::EmailH1)<>"" and PatternCount (Admin::EmailH1: "@")]

                    Set Field [Globals::SMTPit AddressTo: Substitute (Admin::EmailH1 " ": "")]

                    Set Field [Globals::SMTPit Message;"Dear Admin::Envelope1, blahblahblah"]

                    Set Field [Globals::SMPTit Result; External("SMTP-SibjectAssign:; "Appointment Reminder")]

                    Set Field [Globals::SMPTit Result; External("SMTO-Send"; "Transcript="&Globals::SMTPit Transcript")]

                    If (PatternCount(Globals::SMTPit Reslt; "ERROR") = 0]

                    End if

               End if

               Go to Record/Request/Page [Next; Exit after last]

          End Loop

     End if

 

Any help or thoughts would be MUCH appreciated.

 

Thanks!

Outcomes