Hi,

With  Woody , you can use a _javascript_ to make the flowscript.

After validate the form you can do something like that :


function newTellUs()
{
   try
   {
      var form = new Form("context://woody/tellus/forms/entry.xml");
      // The showForm function will keep redisplaying the form until everything is valid
      form.showForm("new-display-pipeline");
      if(form.submitId == "tellus_cancel")
      {
         cocoon.log.debug(">>> TELLUS : User cancel the request.");
         cocoon.redirectTo("http://www.lesoir.be");
      }
      else
      {
         cocoon.log.debug(">>> TELLUS : User pass the validation and wants to submit the request");
       
         var tellusentry = new Packages.com.mpe.cocoon.woody.tellus.TellUsEntry();
         if(tellusentry == null)
         {
            throw "Can not create a new tell us entry";
         }
         TellUsFactory.submitTellUsDocument(tellusentry);
       
         
         //    cocoon.sendPage("new-success-pipeline");
         cocoon.sendPage("new-success-pipeline", bizdata);
         //    form.finish();
      }
   }
   catch(e)
   {
      cocoon.log.error("Can not complete correctly the new Tell Us Message", e);
      cocoon.sendPage("error",
      {
         "error" : e.toString()
      }
      );
   }
}

In this Flowscript , I call a java class where I create a Notes Document in a Db , but you can directly send a mail .

You can also use the "new-success-pipeline" to use get back your data and send a mail (check the block , there must be a sample to send a mail from pipeline)


Hope it could help

Laurent

Reply via email to