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:cinclude="http://apache.org/cocoon/include/1.0"; >
<xsp:logic />
<sendmail:from>[EMAIL PROTECTED]</sendmail:from>
<sendmail:to>[EMAIL PROTECTED]</sendmail:to>
<sendmail:subject>Pipeline Results</sendmail:subject>
<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" />
Email successfully sent.
<p style="color:red;">
An error occurred: <sendmail:error-message/>

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 />

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):

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

// end error
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

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

Reply via email to