You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by do...@cocoon.apache.org on 2004/07/09 10:24:20 UTC
[Cocoon Wiki] Updated: MailBodyViaPipeline
Date: 2004-07-09T01:24:20
Editor: DavidCrossley <cr...@apache.org>
Wiki: Cocoon Wiki
Page: MailBodyViaPipeline
URL: http://wiki.apache.org/cocoon/MailBodyViaPipeline
removed junk attachment
Change Log:
------------------------------------------------------------------------------
@@ -6,51 +6,49 @@
Here's a sendmail XSP, {{{mail.xsp}}} that implements this:
-{{{<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsp:page language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:xsp-request="http://apache.org/xsp/request/2.0"
- xmlns:util="http://apache.org/xsp/util/2.0"
- xmlns:sendmail="http://apache.org/cocoon/sendmail/1.0">
- <email>
- <sendmail:send-mail>
- <sendmail:from>from@example.org</sendmail:from>
- <sendmail:to>to@example.com</sendmail:to>
- <sendmail:subject>Test Email from Cocoon</sendmail:subject>
- <!-- Modify the next line to point to your mail server -->
- <sendmail:smtphost>smtp.example.org</sendmail:smtphost>
- <sendmail:body><xsp:expr>
- <util:get-source uri="cocoon://mail/payload"/>
- </xsp:expr></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>
+{{{<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:xsp-request="http://apache.org/xsp/request/2.0"
+ xmlns:util="http://apache.org/xsp/util/2.0"
+ xmlns:sendmail="http://apache.org/cocoon/sendmail/1.0">
+ <email>
+ <sendmail:send-mail>
+ <sendmail:from>from@example.org</sendmail:from>
+ <sendmail:to>to@example.com</sendmail:to>
+ <sendmail:subject>Test Email from Cocoon</sendmail:subject>
+ <!-- Modify the next line to point to your mail server -->
+ <sendmail:smtphost>smtp.example.org</sendmail:smtphost>
+ <sendmail:body><xsp:expr>
+ <util:get-source uri="cocoon://mail/payload"/>
+ </xsp:expr></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>}}}
You'd use the request parameters logicsheet to get {{{to}}}, {{{from}}}, and {{{smtphost}}}, in practice.
The sendmail logicsheet has been defined in cocoon.xconf, and a matcher added to the pipeline.
-{{{<map:match pattern="send">
- <map:generate type="serverpages" src="mail.xsp" />
- <map:serialize />
+{{{<map:match pattern="send">
+ <map:generate type="serverpages" src="mail.xsp" />
+ <map:serialize />
</map:match>}}}
We've also defined another pipeline for the payload:
-{{{<map:match pattern="payload">
- <map:generate src="payload.xml" />
- <map:serialize type="text" />
+{{{<map:match pattern="payload">
+ <map:generate src="payload.xml" />
+ <map:serialize type="text" />
</map:match>}}}
-[[BR]]
-[[BR]]
-'''Attachment:''' attachment:CambiosRED.txt [[BR]]
+