Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 96551 invoked from network); 9 Feb 2005 23:16:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Feb 2005 23:16:02 -0000 Received: (qmail 90754 invoked by uid 500); 9 Feb 2005 23:15:58 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 90712 invoked by uid 500); 9 Feb 2005 23:15:57 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 90698 invoked by uid 99); 9 Feb 2005 23:15:57 -0000 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=FORGED_MUA_IMS,HTML_50_60,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from Unknown (HELO civmail.civica.com.au) (203.56.2.254) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 09 Feb 2005 15:15:56 -0800 Received: by mail.civica.com.au with Internet Mail Service (5.5.2653.19) id ; Thu, 10 Feb 2005 10:15:20 +1100 Message-ID: <420A997C.3000805@civica.com.au> From: Tony Edwards To: users@cocoon.apache.org Subject: Re: alternative to sendmail logicsheet? Date: Thu, 10 Feb 2005 10:15:08 +1100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C50EFD.3219E600" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C50EFD.3219E600 Content-Type: text/plain; charset="iso-8859-1" Rick, 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: 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: metaFile.xml text/xml Make sure you've declared the sendmail transformer in your sitemap and you're all set: Its a snack. Hope this helps, Regards Tony 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: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > --------------------------------------------------------------------- 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 immediately. 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. --------------------------------------------------------------------- ------_=_NextPart_001_01C50EFD.3219E600 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: alternative to sendmail logicsheet?

Rick,
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:
          &nb= sp; <map:match = pattern=3D"edmUploadFile">     &nb= sp;      
          &nb= sp;     <map:generate = type=3D"session-attr">
          &nb= sp;         <map:parameter = name=3D"attr-name"
value=3D"uploadDocMetaData"/>
          &nb= sp;     </map:generate>  
          &nb= sp;     <map:transform = src=3D"xsl/xml2email.xsl"/>
          &nb= sp;     <map:transform = type=3D"sendmail"/>      &nbs= p;          
          &nb= sp;     <map:serialize type=3D"xml" = />           &= nbsp;  
          &nb= sp; </map:match>
          &nb= sp;
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=3D"1.0"?>
<xsl:stylesheet version=3D"1.0"
    xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
    xmlns:email=3D"http://apache.org/cocoon/transformation/sendmail&q= uot;>


<xsl:template = match=3D"document">
    <document>
        = <email:sendmail>
          &nb= sp; <email:smtphost><xsl:value-of
select=3D"smtpHostName"/></email:smtp= host>      
          &nb= sp; <email:from><xsl:value-of
select=3D"emailFrom"/></email:from> &nb= sp;        
          &nb= sp; <email:to><xsl:value-of = select=3D"edmInbox"/></email:to>   &nb= sp;  
          &nb= sp; <email:to><xsl:value-of = select=3D"emailFrom"/></email:to>   &n= bsp;  
          &nb= sp; <email:subject><xsl:value-of
select=3D"title"/></email:subject> &nbs= p;    
          &nb= sp; <email:body><xsl:value-of = select=3D"assetId"/></email:body>
          &nb= sp; <email:attachment>
          &nb= sp;     <xsl:attribute = name=3D"name"><xsl:value-of
select=3D"fileName"/></xsl:attribute>=
          &nb= sp;     <xsl:attribute = name=3D"url"><xsl:value-of
select=3D"uploadURL"/></xsl:attribute>
          &nb= sp; </email:attachment>
          &nb= sp; <email:attachment>
          &nb= sp;     <xsl:attribute = name=3D"name">metaFile.xml</xsl:attribute>
          &nb= sp;     <xsl:attribute = name=3D"mime-type">text/xml</xsl:attribute>
          &nb= sp;     = <email:content><document><xsl:copy-of
select=3D"*"/></document></email:content&= gt;
          &nb= sp; = </email:attachment>        = ;  
        = </email:sendmail>
    </document>
</xsl:template>

<xsl:template match=3D"@*|node()" =
priority=3D"-2"><xsl:copy><xsl:apply-temp= lates
select=3D"@*|node()"/></xsl:copy></xsl:te= mplate>
<xsl:template match=3D"text()" = priority=3D"-1"><xsl:value-of
select=3D"."/></xsl:template>

</xsl:stylesheet>
Make sure you've declared the sendmail transformer = in your sitemap and
you're all set:
<map:transformer name=3D"sendmail" =
src=3D"org.apache.cocoon.mail.transformation.SendMailTrans= former"
logger=3D"sitemap.transformer.sendmail"/> &nb= sp;    

Its a snack.

Hope this helps,
Regards
Tony

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: = users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: = users-help@cocoon.apache.org
>

---------------------------------------------------------------= ------
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 = immediately.

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.

---------------------------------------------------------------= ------

------_=_NextPart_001_01C50EFD.3219E600--