multiplexer & edit workflow

Author Message

ludo thomas

Thursday 30 June 2005 7:38:58 am

Hi!

I try to make a workflow for sending a mail after having registered a new newsletter reciever.
I've created a simple workflow.
that's working well.
But the problem is that when I create something in admin interface, I receive the mail....
So I want to limit the execution of the workflow just to create new receiver.

I try to make a multiplexer workflow who is calling my first sending-mail-workflow just for the receiver's class.

It never works.

perhaps is it a bug?
perhaps is it possible to specify in my first workflow that I want to limit execution just for one class?

here is my workflow code:

function execute( &$process, &$event )
{
 $parameters = $process->attribute( 'parameter_list' );
        $objectID =& $parameters['object_id'];
       // $object =& eZContentObject::fetch( $parameters['data_map'] );
	  $obj =& eZContentObject::fetch($parameters['object_id']);
$data_map=& $obj->attribute( 'data_map' );
$email = $data_map['email']->content();



$mail = new eZMail();
 			include_once( 'lib/ezutils/classes/ezmail.php' );
            include_once( 'lib/ezutils/classes/ezmailtransport.php' );
			include_once( "lib/ezutils/classes/ezhttptool.php" );
include_once( "kernel/classes/datatypes/ezuser/ezuser.php" );
include_once( "kernel/classes/ezcontentclassattribute.php" );
include_once( "kernel/classes/ezcontentclass.php" );

	 $emailSender ='[email protected]';
  	
	$receiver = $email;
  	$body='Nous avons le plaisir de vous annoncer votre inscription à notre newsletter';
            
            $mail->setSender( $emailSender );		
            $mail->setReceiver( $receiver );
            $subject = 'inscription à la newsletter';
           
            $mail->setSubject( $subject );
            $mail->setBody( $body );
            $mailResult = eZMailTransport::send( $mail );
//return EZ_WORKFLOW_TYPE_STATUS_ACCEPTED;

$process->RedirectUrl = "/";
return EZ_WORKFLOW_TYPE_STATUS_REDIRECT ;


}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.