sleepinggypsy Posted February 4, 2006 Posted February 4, 2006 can you generate emails with xml/xslt and FMSA or do you need middleware such as php to do so?
Martin Brändle Posted February 4, 2006 Posted February 4, 2006 You can with XML/XSLT. Look at the FMSA Custom Web Publishing Guide, fmxslt:send_email function and the various examples posted here in the forum.
sleepinggypsy Posted February 6, 2006 Author Posted February 6, 2006 I read that and now am more confused and hope you can clarify. I am new to xml. So my question is can I use IWP to send an open url with the xml parameters which have been captured from the db to FMSA and have it send out the email automatically BEHIND THE SCENES? Scenario I am proposing: user creates record in IWP with email address. User clicks submit button in IWP which sends an openurl script with xml parameters, smtp parameters... and the FMSA spits out an automatic email? I hope this makes sense. I could not follow the other thread discussion with "Curl", etc. Thanks once again!
Martin Brändle Posted February 6, 2006 Posted February 6, 2006 Yes, this is possible. If you can wait and I can find the time, I can post an example in the other thread.
sleepinggypsy Posted February 7, 2006 Author Posted February 7, 2006 (edited) Thanks Martin, I appreciate the help when you get the chance! I also read the pages in fmsa8_custom_web_guide.pdf on emailing and if I understand you correctly I need to pass these params via an open URL script step in IWP? It seems as if this will always force a pop-up window (acceptable but not ideal, esp. if user has them blocked). Secondly, as I am totally unfamiliar w/ xsl style sheet creation, I have no idea how to create the style sheet for emailing. Again, i don't care about the "formatting" of the email, as i don't want the sender of the email to see it happening. I do however, want in the body of the email being sent a link that when clicked will perform a script in FMP (which is probably a completely different problem). Again scenario: User creates record in IWP (record contains email field of creator)>User clicks button in IWP>button generates an email behind the scenes back to user (confirmation of email address)>User receives email with a link that when clicked runs a script within FMP (the primary effect of this script would be to set the user as "Active" and then the script would generate another email behind the scenes). Edited February 9, 2006 by Guest
Martin Brändle Posted February 9, 2006 Posted February 9, 2006 Part 1, e-mailing, solved. See attached file (quick and dirty). Part 2 will come later, but maybe you can figure it out yourself. Check the XML query syntax in the FMSA Custom Web Guide. You need just to construct an URL that edits the record. test_emailiwp.zip
sleepinggypsy Posted February 10, 2006 Author Posted February 10, 2006 Martin, first thank you so much for taking the time! I am trying to test your solution but am getting this error: The requested stylesheet file could not be found (FILE-ER0001) Where should I place the stylesheet? Mac OSX? Thanks again!
Martin Brändle Posted February 10, 2006 Posted February 10, 2006 FMSA 8: /Library/FileMaker Server/Web Publishing/xslt-template-files FMSA 7: /Library/FileMaker Server 7/Web Publishing/xslt-template-files
sleepinggypsy Posted February 10, 2006 Author Posted February 10, 2006 Sorry for the hand-holding needed here but I moved the xsl file (I'm using FMSA 7) and am still getting the same error. Perhaps I need to call the file differently from withing FM open URL? I am testing on the same machine so all I changed for my IP is>localhost: "http://localhost/fmi/xsl/test_emailiwp.xsl?-grammar=fmresultset&-db=test_emailiwp&-lay=test_emailiwp&id=" & test_emailiwp::id & "&-max=1&-find" I feel so close!!!!
Martin Brändle Posted February 10, 2006 Posted February 10, 2006 localhost does not work for an external user. You have to enter the hostname (www.something.topdomain)
sleepinggypsy Posted February 11, 2006 Author Posted February 11, 2006 still not working. I changed to: http://10.0.1.4/fmi/xsl/test_emailiwp.xsl?-grammar=fmresultset&-db=test_emailiwp&-lay=test_emailiwp&id=1&-max=1&-find Here is the error page: Error.pdf
Martin Brändle Posted February 11, 2006 Posted February 11, 2006 Did you set the permissions (-rw-rw----) and owner/group (e.g. admin/fmsadmin) of the stylesheet file correctly?
sleepinggypsy Posted February 11, 2006 Author Posted February 11, 2006 After palying with the user/ groups (either system or account) all with r&w access, no more error dialogue. However, no email is generated. I have attached my web publishing console screen. I am trying to send using my .mac account. I do put in my account and password (as text). Any more suggestions? Thanks again! FileMaker_Server_Web_Publishing_Administration_Console.pdf
Martin Brändle Posted February 11, 2006 Posted February 11, 2006 (edited) Not sure if that works with .mac Did/Can you configure a mail server in the server administration tool of Mac OS X Server? When that is done, you should setup CRAM-MD5 authentication in the WPE administration, not "None", as in your screenshot before. Edited February 11, 2006 by Guest
sleepinggypsy Posted February 11, 2006 Author Posted February 11, 2006 Martin, I have a hosting account with Point In Space. I just emailed John to see if I can get the test files uploaded on my server there to test. It is eventually where I will want to run the IWP emails from anyway and i think that part of the problem could be my local setup and testing. I don't have OSX Server, just OSX. Would there be any reason why your solution woudn't work in a hosted environment? Thanks again!
Martin Brändle Posted February 12, 2006 Posted February 12, 2006 I had tested it on our servers (OS X Server, FMSA8) before i posted it here, and it worked. As said above, it is quick and dirty, just an example how it could work. Anyway, you have to adapt both the IWP part and the XSLT file to how and what you want to send. I had also thought about a solution, that would work without a popup window, but would be asynchronous. It would run along a the following line, and use the curl idea of Søren: - when the user clicks on the e-mail button, a timestamp is written to the record - a cron job regularly checks with curl for the records with newest timestamps, e.g. it loads an XSLT that works through those records and sends the e-mails
sleepinggypsy Posted February 12, 2006 Author Posted February 12, 2006 I have the db you created hosted: http://rentalfinders.pointinspace.com:80/fmi/iwp/cgi?-db=RTFtest_emailiwp&-loadframes I haven't made any changes to the style sheet. Also, here's a copy of the modified script step: "http://rentalfinders.pointinspace.com/fmi/xsl/test_emailiwp.xsl?-grammar=fmresultset&-db=RTFtest_emailiwp&-lay=test_emailiwp&id=" & test_emailiwp::id & "&-max=1&-find" If you try to send the email, a completely different error page results. I am totally lost! Now that it is online, perhaps you can see what changes need to be made. Thanks for taking the time to help me (and hopefully others) on this!
John May - Point In Space Posted February 12, 2006 Posted February 12, 2006 You need to add /rentalfinders/ in your URL, eg: http://rentalfinders.pointinspace.com/fmi/xsl/rentalfinders/test_emailiwp.xsl?-grammar=fmresultset&-db=RTFtest_emailiwp&-lay=test_emailiwp&id=1&-max=1&-find - John
sleepinggypsy Posted February 12, 2006 Author Posted February 12, 2006 Hey John, I just dropped you an email. Perhaps you can help me get this thing up an running at PIS and then I can post the working scenario that Martin has so generously helped me with!
Recommended Posts
This topic is 6857 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now