Custom Web Publishing Guide

Table Of Contents
Chapter 5
|
Developing FileMaker XSLT stylesheets 67
1 The fmxslt:send_email(String smtpFields, String xsltFile, Node xml, boolean includeImages) function sends an
email message consisting of XML data that is processed by the email stylesheet you specify in this
function.
1 For the xsltFile parameter, specify the name of the email stylesheet by entering a URL that is relative
to the main processing stylesheet file for the request.
1 For the xml parameter, specify the parent node of the XML data that you want to use with the email
stylesheet. To send an email message using the same XML data that is being displayed in the browser,
simply provide the XPath for the root of the document: “/”. Otherwise, you can use a different XML
document by first loading it with the
document() function, and then passing that document into the
fmxslt:send_email() function.
1 For the includeImages parameter, specify a boolean value of true() to have the Web Publishing Engine
include all images specified in the HTML of the email message as attachments. This parameter
includes both FileMaker database images as well as non-database images from other locations. The
Web Publishing Engine changes the image URLs to refer to the attachments. Performance can be slow
if the image files are numerous or large. If you specify
false (), the Web Publishing Engine does not
change the URLs for the images. If the URLs are absolute, the email client will attempt to load the
images from the web server.
Here is an example of using the fmxslt:send_email(String smtpFields, String xsltFile, Node xml, boolean
includeImages)
function inside an XPath statement, such as inside the <xsl:if> element:
fmxslt:send_email('tom_jones@company.com?subject=project%20status&amp;from=john_smith@company.com
&amp;cc=jane_doe@company.com','my_mail_template.xsl', /, true())
For information about configuring the Web Publishing Engine to connect to a SMTP server, see the
FileMaker Server Advanced Web Publishing Installation Guide.
Using the header functions
You can use the fmxslt:get_header() function to read information from the HTTP request and response
headers, and the
fmxslt:set_header() function to write information to the headers. These functions are useful
if the client can use the header information to retrieve information from the web server, or if you need to set
a HTTP header for other reasons.
Notes
1 The name used in the fmxslt:get_header() and fmxslt:set_header() functions, and the value in the
fmxslt:set_header() function can be a string of any length.
1 The fmxslt:set_header() function and the fmxslt:set_status_code() function require the <?xslt-cwp-buffer?>
processing instruction. See
“Using content buffering” on page 63.
Header extension function
Data type
returned Description
fmxslt:get_header(String name) string Returns the specified header value
fmxslt:set_header(String name, String value) void Sets the specified header value
fmxslt:set_status_code(Number status-code) void Sets the HTTP status code