cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Schlabach <tschlab...@apache.org>
Subject Re: [CForms] How to send data from a form in an email? (solved)
Date Sat, 12 Feb 2005 17:18:07 GMT
 >> 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>

Regards,
Torsten


Torsten Schlabach schrieb:
> Hi!
> 
> Yes ... as I said ... this all works fine.
> 
> But I found the answer myself in the meanwhile. It's here:
> 
> http://wiki.apache.org/cocoon/Flow
> 
> (last entry)
> 
> Even that FAQ entry is not too straightforward to me, but it contained 
> the hint I was looking for. In the sitemap you can say:
> 
>   <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:act>
> 
> The flow-attribute was the missing piece. I will check and see wether I 
> should offer a documentation patch, because I did not find this anywhere 
> in the documentation.
> 
> Depending on what one wants to do, you can attach the result of a 
> pipeline to an email using
> 
>  <map:parameter name="attachments"
>                    value="cocoon://yourpipeline"/>
> 
> If one wants to send a text only email containing any values entered in 
> the CForms, this should work:
> 
> <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="body" value="Dear Mr. {flow-attribute:name}, 
> ..." />
>   </map:act>
> 
> I haven't tried this. It would be quite cumbersome if you have a larger 
> text in which you maybe only want to include an order number for example 
> and you had to put all that email text into the sitemap.
> 
> 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, but this does NOT 
> work:
> 
> <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="body" value="cocoon://yourpipeline" />
>   </map:act>
> 
> (Being that verbose just for others who might have the same problem and 
> find this email in the archives.!)
> 
> Regards,
> Torsten
> 
> Geert Josten schrieb:
> 
>> Hi,
>>
>> If I have understood the tutorial, than that data should be available 
>> in a jx template to which you direct with sendPage or sendPageAndWait. 
>> See:
>>
>> http://cocoon.apache.org/2.1/userdocs/flow/tutor.html
>>
>> Cheers
>>
>> Torsten Schlabach wrote:
>>
>>> Geert Josten schrieb:
>>>
>>>  >> That layer doesn't have to be Flowscript.  :-)
>>>
>>>  >> A much better reason to consider using Flowscript is (to my humble
>>>  >> opinion): continuation..
>>>
>>>  >> CForms is just handy to connect data to 'HTML' forms (as far as I
>>>  >> know, please correct me if I'm totally wrong)...
>>>
>>> I probably did not make my problem clear enough. I am setting up a 
>>> multi-page form wizard, which is exactly what CForms and Flow are 
>>> made for. And this works fine.
>>>
>>> Once all data is entered (and validated, which is why CForms / Flow 
>>> need to be in the picture) I want to email this data somewhere.
>>>
>>> What concerns me is that the Cocoon documentation talks about some 
>>> generators, that are aware of data that comes from the 
>>> cocoon.sendPage(url, data) or cocoon.sendPageAndWait(url, data) calls.
>>>
>>> Regards,
>>> Torsten
>>>
>>>>>  >> I haven't got around using CForms and jx, so can't tell how
fields
>>>>>  >> are passed in that case...
>>>>>
>>>>> But this is 1.000.000 EUR question. The difference is that when 
>>>>> using CForms / Flowscript there is a layer in between the request 
>>>>> values and the parsed data.
>>>>>
>>>>> Regards,
>>>>> Torsten
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> That layer doesn't have to be Flowscript. :-)
>>>>
>>>> A much better reason to consider using Flowscript is (to my humble 
>>>> opinion): continuation..
>>>>
>>>> CForms is just handy to connect data to 'HTML' forms (as far as I 
>>>> know, please correct me if I'm totally wrong)...
>>>>
>>>> Cheers
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message