You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Scherler, Thorsten" <Th...@weidmueller.de> on 2002/12/02 13:58:19 UTC

Sendmail serial email

Hello group,

I am still trying to send a serial email with cocoon ... and I am stucked big time

I got the sendmail logic sheet runnig (without the possiblity to attach a file or a URL).

I have my query (with esql) running.

Now I want to do the following:
The query looks for the date on which information has to be send (info.xsp:)
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/v2" xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<dataset>
<esql:connection>
<esql:pool>IDC2</esql:pool>
<esql:execute-query>
<esql:query>
select * from info where Info_datum = #<xsp-request:get-parameter name="date"/># 
<address>
<bname1>
<esql:get-string column="business_name"/>
</bname1>
<bname2>
<esql:get-string column="business_name_2"/>
</bname2>
<bname3>
<esql:get-string column="business_name_3"/>
</bname3>
<street>
<esql:get-string column="address"/>
</street>
<ZIP>
<esql:get-string column="zip_code"/>
</ZIP>
<City>
<esql:get-string column="city"/>
</City>
<country>
<esql:get-string column="country"/>
</country>
<telephone_number>
<esql:get-string column="telephone_number"/>
</telephone_number>
</address>
<aktion>
<Info_datum>
<esql:get-date column="Info_datum"/>
</Info_datum>
</aktion>
<WD>
<district>
<esql:get-string column="district"/>
</district>
<ADM>
<name>
<esql:get-string column="ADM"/>
</name>
<email>
<esql:get-string column="ADM_email"/>
</email>
</ADM>
</WD>
</client>
</esql:row-results>
</esql:results>
<esql:no-results/>
<esql:error-results/>
</esql:execute-query>
</esql:connection>
</dataset>
</xsp:page>

Now I want to send each ADM an eMail. 
I have the following sendmail.xsp. I have to replace "empfaenger" with the <email><esql:get-string column="ADM_email"/></email> :

<?xml version="1.0" encoding="UTF-8"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:xsp-request="http://apache.org/xsp/request/2.0" xmlns:sendmail="http://apache.org/cocoon/sendmail/1.0">
<page>
<xsp:expr>
<xsp-request:get-parameter name="./ADM/email"/>
</xsp:expr>
<xsp:logic>   
   String empfaenger = 
   "thorsten.scherler@weidmueller.de\n";
  </xsp:logic>
<xsp:logic>
   String text =
   "\n"+
   "something\n"+
   "\n"+
   "more:\n"+
   empfaenger;
   </xsp:logic>
<xsp-request:get-parameter name="date"/>
<sendmail:send-mail>
<sendmail:charset>ISO-8859-1</sendmail:charset>
<sendmail:from>user@mydomain.com</sendmail:from>
<sendmail:to>
<xsp:expr>empfaenger</xsp:expr>
</sendmail:to>
<sendmail:cc>
<xsp:expr>empfaenger</xsp:expr>
</sendmail:cc>
<sendmail:subject>D 200203 V</sendmail:subject>
<!-- Modify the next line to point to your mail server -->
<sendmail:smtphost>mail.weidmueller.com</sendmail:smtphost>
<sendmail:body>
<xsp:expr>text</xsp:expr>
<xsp-request:get-parameter name="date"/>
</sendmail:body>
</sendmail:send-mail>
<send>ok</send>
</page>
</xsp:page>

How can I do that?

Write a xsl with Processing instruction to build the sendmail file on the fly?

I would rather like not to have to do that!

Any ideas?

> Mit freundlichem Gruss,
> 
> Thorsten Scherler
> Marketing / Telefonmarketing
> 
> Weidmüller GmbH & Co.
> P.O. Box 2807
> 33058 Paderborn
> Tel.:+ 49 - 5252-960-350
> Fax:+ 49 - 5252-960-116
> eMail: thorsten.scherler@weidmueller.de
> http://www.weidmueller.de
> 
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>