March 14, 20178 yr Hi all We have a web based tickets portal which creates new messages in our filemaker database - this is for customers' use. It does this using the PHP API (the website was developed by a third party). We would like the owners of tickets to be notified when the customer has added a message to one of the tickets that they are in charge of. Is there a way for filemaker/filemaker server to trigger a 'send email' script when a new record is created via the web portal? Or would it be simpler for this action to occur on the web side? Many thanks
March 14, 20178 yr Hello When your customers raise a new ticket some PHP is being executed which creates the corresponding record in your FileMaker database. The easiest thing to do to send your customer an email at this time would be to add a few lines of PHP code that runs a FileMaker script, which sends the email using the built-in SMTP features of FileMaker Server. The PHP code would look something like :- $appointmentID = "123456"; // you would get this from the context of your PHP to this point $layoutName = 'SendEmailLayout'; // a valid layout name in your database which your script would run from the context of $scriptName = 'SendEmailScript'; // the name of your FileMaker script that sends an email when on the layout named above $arguementToPass = $appointmentID; // this will pass the correct appointment ID to FileMaker so that it emails the correct customer $myScript = $fm->newPerformScriptCommand($layoutName,$scriptName,$arguementToPass); // this script will use the appointmentID to find the correct customer and email them $result = $myScript->execute(); // this tells the web browser to run the FileMaker script If you would like some local professional help with this PHP please DM me, we are a UK-based Platinum certified developer. Edited March 14, 20178 yr by rwoods
March 14, 20178 yr 1 hour ago, sal88 said: Is there a way for filemaker/filemaker server to trigger a 'send email' script when a new record is created via the web portal? Or would it be simpler for this action to occur on the web side? I believe you are asking the wrong question, both FileMaker and the web can send email perfectly fine. Is this a spread point for information? Then letting the submit button on the web may be the way to go, as mentioned by @rwoods Is this a starting point for somebody to prepare something inside FileMaker? Then letting the preparations be done first and click at the end of the preparations to trigger an email may give a more live feeling to the other pariticipants. Edited March 14, 20178 yr by ggt667
March 14, 20178 yr Author Thanks very much rwoods that looks to be the 'ticket', I will pass this on to the web developer but if there's any problems i'll be sure to contact you.ggt667 I'm not sure what the difference between spread point and starting point is. The customer who is using the web portal is adding a query/information (as a new related record) to an existing support ticket. Our engineers can see within filemaker that the ticket has been updated (if they have their list of tickets on the screen), but it's more efficient if they can also be emailed a notification of the update as soon as it occurs.
March 14, 20178 yr So you are basically spreading the information to everybody no need for 1 person to verify the data and then inform the others. Then what @rwoods suggest is probably the better option.
March 14, 20178 yr Author Understood, thanks @ggt667. Out of interest, is there a specific way for filemaker server to perform the script but without any such instruction from PHP? i.e. could it trigger when a new record has been created (of which the 'type' field would be set to 'web') and then perform the script? Or would this require a plugin or scheduled script that runs every minute, checking for newly created web originating records?
March 18, 20178 yr You could write a script for server that is triggered every 5 mins by the server's script scheduler that checks if a record has a creation timestamp last 5 mins by your php script user, and if so issue an email. Edited March 18, 20178 yr by ggt667
March 30, 20178 yr Author Thanks ggt667. My script is definitely activated via PHP however the send mail step is not working at all - either via plugin or the inbuilt send mail (smtp) script step. Am I missing a trick?
March 30, 20178 yr I had a similar problem several years ago, and ended up just sending the mail in PHP, using a cron to check if there was a flag set in FM
March 30, 20178 yr @ggt667 You're right, but I knew how to do in in PHP, and I learned how to run a PHP script with a cron. It's a kludge, I know, but it has worked fine for 8 years, so I never cleaned it up.
Create an account or sign in to comment