El s�b, 12-02-2005 a las 18:18, Torsten Schlabach escribi�:
>  >> Maybe there is a way of using the result of a pipeline not only as an
>  >> email attachment but also as the body of the message,
> 
> There is. RTFM helped in that case. Just using the parameter src instead 
> of body will yield the desired result. This opens up all the doors to 
> apply all of Cocoons power the email to be send. One could even think of 
>   i18n and the like ...
> 
> In clear text:
> 
>   <map:act type="sendmail">
>       <map:parameter name="smtphost" value="localhost"/>
>       <map:parameter name="to" value="{flow-attribute:email}"/>
>       <map:parameter name="subject" value="Mitglied!"/>
>       <map:parameter name="src" value="cocoon://yourpipeline" />
>     </map:act>
> 

...or just use it like that:
<map:pipeline>
      <map:match pattern="*_email.jx">
      <map:generate type="jx" src="{1}_email.xml"/>
        <map:transform type="sendmail">
          <map:parameter name="smtphost" value="localhost"/>
          <map:parameter name="from" value="[EMAIL PROTECTED]"/>
        </map:transform>
        <map:transform type="xslt" src="{1}_email.xsl" />
        <map:serialize type="xhtml"/>
      </map:match>
    </map:pipeline>

This way you have your email in the {1}_email.xml. e.g.
<document
    xmlns:email="http://apache.org/cocoon/transformation/sendmail";
    xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";
    >
  <jx:set var="date" value="${java.util.Date()}"/>
    <email:sendmail>

    <email:to>[EMAIL PROTECTED]</email:to> 

    <email:subject>test</email:subject>

    <email:body>test #{date}</email:body>

  </email:sendmail>
</document>


Makes it easier to reuse the pipe. ;-)

HTH
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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

Reply via email to