I've been stumbling the past couple of days through the sendmail logicsheet and sendmail actions in 2.1-M1.

Here's what I'm trying to do:

Include generated content (i.e. content produced by a pipeline) into the body of an email sent by sendmail action or logicsheet.

----

Unfortunately, neither the documentation, nor the cocoondev.org wiki discuss this. They go into great detail into how to add a request parameter to a mail, but not generated content. Thus, I've been going at this by trial and error.

The sendmail action has been a deadend, so I've looked at the sendmail logicsheet. Below is mail.xsp, my attempt to implement sending a message body created by a pipeline. Please note that I have defined the necessary namespaces in the xsp:page element:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp";
xmlns:sendmail="http://apache.org/cocoon/sendmail/1.0";
xmlns:cinclude="http://apache.org/cocoon/include/1.0"; >
<email>
<xsp:logic />
<sendmail:send-mail>
<sendmail:from>[EMAIL PROTECTED]</sendmail:from>
<sendmail:to>[EMAIL PROTECTED]</sendmail:to>
<sendmail:subject>Pipeline Results</sendmail:subject>
<sendmail:smtphost>smtp.example.org</sendmail:smtphost>
<sendmail:body>The results of processing the pipeline triggered at the uri: workPlanning/contents. are below.<br/>
<!-- NB: the request below has been tested and works when called directly -->
<cinclude:include src="cocoon://workPlanning/contents" element="included" />
</sendmail:body>
<sendmail:on-success>
<p>
Email successfully sent.
</p>
</sendmail:on-success>
<sendmail:on-error>
<p style="color:red;">
An error occurred: <sendmail:error-message/>
</p>
</sendmail:on-error>
</sendmail:send-mail>
</email>
</xsp:page>


The sendmail logicsheet has been defined in cocoon.xconf, and a matcher added to the pipeline.

        <map:match pattern="workPlanning/send">
                <map:generate type="serverpages" src="workPlanning/mail.xsp" />
                <map:serialize />
        </map:match>

When we request workPlanning/send, Cocoon fails with an error:

org.apache.cocoon.components.language.LanguageException: Error compiling mail_xsp:
ERROR 1 (org/apache/cocoon/www/samples/xmlform/workPlanning/mail_xsp.java):
...
"",
"br",
"br",
xspAttr


// start error (lines 157-157) "Syntax error on token ";", ")" expected"
    );

// end error
    xspAttr.clear();
...
Line 157, column 0: Syntax error on token ";", ")" expected

I'd appreciate some assistance with this. Once I've found my way around this problem, I'll write up a how-to for the cocoondev.org wiki.

----
Bill Humphries
http://www.whump.com/moreLikeThis/


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to