cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Edwards <>
Subject Re: alternative to sendmail logicsheet?
Date Wed, 09 Feb 2005 23:15:08 GMT
I had to include mail functionality just last week and I approached the 
task with some trepidation as it seems that both the sendmail action and 
logicsheet are starting to lose favour with the advent of Cforms and flow.
What to do?
I did some scouring and stumbled across the sendmail transformer. Its 
been included for quite some time but probably hasn't achieved the 
prominence of the other two methods.
Check it out.
In the sitemap I added this:
            <map:match pattern="edmUploadFile">             
                <map:generate type="session-attr">
                    <map:parameter name="attr-name" 
                <map:transform src="xsl/xml2email.xsl"/>
                <map:transform type="sendmail"/>                  
                <map:serialize type="xml" />               
I'm passing an xml document created in flow in a session attribute but 
it could come from XSP. I then transform it using a stylesheet, the guts 
of which is:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"

<xsl:template match="document">
            <email:to><xsl:value-of select="edmInbox"/></email:to>     
            <email:to><xsl:value-of select="emailFrom"/></email:to>    
            <email:body><xsl:value-of select="assetId"/></email:body>
                <xsl:attribute name="name"><xsl:value-of 
                <xsl:attribute name="url"><xsl:value-of 
                <xsl:attribute name="name">metaFile.xml</xsl:attribute>
                <xsl:attribute name="mime-type">text/xml</xsl:attribute>

<xsl:template match="@*|node()" 
<xsl:template match="text()" priority="-1"><xsl:value-of 

Make sure you've declared the sendmail transformer in your sitemap and 
you're all set:
<map:transformer name="sendmail" 

Its a snack.

Hope this helps,

Rick Tyler wrote:

> Since no-one answered my question about how to fix the BROKEN sendmail
> logicsheet example distributed with Cocoon-2.1.6, can anyone please
> tell me of an alternative method of sending email from XSP?  I know
> about the sendmail action method which doesn't work either in the Send
> EMail sample application), but that wouldn't be sufficient in any case
> because I need to do other processing besides just sending an email.
> Please help somebody.
> RT
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

This email is from Civica Pty Limited and it, together with any attachments,
is confidential to the intended recipient(s) and the contents may be legally
privileged or contain proprietary and private information. It is intended
solely for the person to whom it is addressed. If you are not an intended
recipient, you may not review, copy or distribute this email. If received in
error, please notify the sender and delete the message from your system
Any views or opinions expressed in this email and any files transmitted with
it are those of the author only and may not necessarily reflect the views of
Civica and do not create any legally binding rights or obligations
whatsoever. Unless otherwise pre-agreed by exchange of hard copy documents
signed by duly authorised representatives, contracts may not be concluded on
behalf of Civica by email. 
Please note that neither Civica nor the sender accepts any responsibility
for any viruses and it is your responsibility to scan the email and the
attachments (if any). All email received and sent by Civica may be monitored
to protect the business interests of Civica. 

View raw message