brad2610 Posted February 11, 2005 Posted February 11, 2005 I have tried everything under the sun...hoping someon can help out. I am attempting to email results from a form. The email shows up perfectly. The subject line is perfect..... the info in the Body of the email i cannot get correct. Here is my code for the email: (note that 'Sel' & 'Title' are fields in my database) The result of this would be--- SelTitle---- with no breaks. How can I get the email to format with all my data broken into seperate lines. xsl:variable name="email_status" select="fmxslt:send_email('[email protected][email protected]&subject=Music Connection has received your BOM&',concat('Sel#:',fmrs:resultset/fmrs:record/fmrs:field[@name='Sel'],/,'Title:',fmrs:resultset/fmrs:record/fmrs:field[@name='Title']))"/ thanks for any input Brad
Martin Brändle Posted February 11, 2005 Posted February 11, 2005 I'm little bit too nitpicking (correct expression?), but can you assume that you always get back one record in resultset? Otherwise you should really address the record. Why do you need the / between the two commas (this would be the XPath of the root node of your XML tree)? Try this: <xsl:variable name="bz" select="fmrs:resultset/fmrs:record[1]"> <xsl:variable name="email_status" select="fmxslt:send_email('[email protected][email protected]&subject=Music Connection has received your BOM',concat('Sel#:',$bz/fmrs:field[@name='Sel']/fmrs:data[1],&xD;,'Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1]))"/> The &xD; is the character expression for the carriage return. Martin
brad2610 Posted February 11, 2005 Author Posted February 11, 2005 Thank you for the code...i will test it out. What do you mean by "really address the record"? If b yt his you mean show the entire record the YES! How would I do this? thanks Again Brad
Martin Brändle Posted February 11, 2005 Posted February 11, 2005 It's already there in my example: fmrs:resultset/fmrs:record[1] means "take the first record of my resultset". Martin
brad2610 Posted February 11, 2005 Author Posted February 11, 2005 Using your exact code I am getting an error of "The reference to entity sunject must end with a ';' delimiter I canot seem to get this corrected. Any suggestions? thanks brad
brad2610 Posted February 11, 2005 Author Posted February 11, 2005 Also telling me that the &xD was reference but not declared. Sorry for the basic questions but I am a newbie just trying to help out my family business.
Martin Brändle Posted February 12, 2005 Posted February 12, 2005 Sorry, made two little mistakes. Try this: <xsl:variable name="bz" select="fmrs:resultset/fmrs:record[1]"/> <xsl:variable name="email_status" select="fmxslt:send_email('[email protected][email protected]&subject=Music Connection has received your BOM',concat('Sel#:',$bz/fmrs:field[@name='Sel']/fmrs:data[1],'
','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1]))"/>
brad2610 Posted February 16, 2005 Author Posted February 16, 2005 hmmm... nothing posted above. Can you repost?
Martin Brändle Posted February 16, 2005 Posted February 16, 2005 Look again at the post above. Strange - I was pretty sure my answer showed 3-4 days ago. This forum engine sometimes seem to intermingle "<" and "<" Martin
brad2610 Posted February 16, 2005 Author Posted February 16, 2005 Beautiful... that works. Now this leads into a new issue though. In actuality I have about 30 fields that need to be listed in this email. It seems as soon as I get to about 20 lines I get the follwoing error: java.lang.ArrayIndexOutOfBoundsException: 16 I think this is a limit to the size of the string. Do you know how to increase this size? For refernce here is the code I am using now: xsl:variable name="bz" select="fmrs:resultset/fmrs:record[1]"/ xsl:variable name="email_status" select="fmxslt:send_email('[email protected][email protected]', concat('Sel#:',$bz/fmrs:field[@name='Sel']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1], ' ','Title:',$bz/fmrs:field[@name='Artist']/fmrs:data[1]))"/
Martin Brändle Posted February 16, 2005 Posted February 16, 2005 Interesting, it seems that concat() has a limited number of strings to be concatted. Did you try nested concats? Or even, you can save half of your ' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1] construct in a variable first: <xsl:variable name="firsthalf" select=" concat(' Title:',$bz//fmrs:field[@name='Title']/fmrs:data[1],' Title:'....)"/> and the other half: <xsl:variable name="secondhalf" select="analogous..."/> and then: <xsl:variable name="email_status" select="fmxslt:send_email('[email protected][email protected]&subject=Music Connection has received your BOM',concat('Sel#:',$bz/fmrs:field[@name='Sel']/fmrs:data[1],' ','Title:',$bz/fmrs:field[@name='Title']/fmrs:data[1],$firsthalf,$secondhalf))"/> BTW, you can substitute 'bz' by 'record' (that was a little joke I tried to find out if you are "the" brad2610). Martin
Newbies Tomos Tyler Posted February 17, 2005 Newbies Posted February 17, 2005 As a side note is there any ability for XSL to call the email address from the completed form and send an email to that user i.e. feedback from form logged, I have tried something like this but there is no response at all via the browser xsl:variable name="email_feedback" select="fmxslt:send_email(fmrs:resultset/fmrs:record/fmrs:field[@name='Email2']/fmrs:data,'[email protected]&subject=Job Logged',concat(fmrs:resultset/fmrs:record/fmrs:field[@name='LocationE']/fmrs:data,' ','Descr:',fmrs:resultset/fmrs:record/fmrs:field[@name='FaultDescription']/fmrs:data))"/ Tomos
Martin Brändle Posted February 17, 2005 Posted February 17, 2005 Seems to get a long thread here One of the three variants of the fmxslt:send_email extension function is of the following form: fmxslt:send_email(String smtpFields, String body) Now you have something like: fmxslt:send_email(String to_address, String remaining_smtpFields, String body). Compare with your construct. Therefore, you should concat the strings to_address and remaining_smtpFields like this: <xsl:variable name="email_feedback" select="fmxslt:send_email(concat(fmrs:resultset/fmrs:record/fmrs:field[@name='Email2']/fmrs:data,'[email protected]&subject=Job Logged'),concat(fmrs:resultset/fmrs:record/fmrs:field[@name='LocationE']/fmrs:data,' ','Descr:',fmrs:resultset/fmrs:record/fmrs:field[@name='FaultDescription']/fmrs:data))"/> Martin
Newbies Tomos Tyler Posted February 17, 2005 Newbies Posted February 17, 2005 May the choirs of the heavens sing you to sleep.... Fantastic, I tried using concat, but neglected to include the from string. It works, it works, it works..... if you had not guessed I was kind of impressed. I have had issues migrating my databases from Fm6 to 7 as I utilise a lot of AppleScript to complete the short comings of Filemakers GUI (mind you try doing some of my scripts in any other Database app.... ), but nothing prepared me moving from CDML (Database web forms 101) to XSL..... Thanks heaps Tomos BTW, if anyone is looking at implementing this there is only one small addition that has to be made to the code, between the ampersand and the "subject" name you will need "amp;" i.e. .au&subject Minor really......
brad2610 Posted February 17, 2005 Author Posted February 17, 2005 Martin you are a genius... Nesting the concat was perfect run around to the string limts. Thanks again!
Recommended Posts
This topic is 7219 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