How to send email with specific worflow

Author Message

Stéphane Bullier

Friday 09 February 2007 7:35:05 am

Hello all

I have to make in place a worflows for sending an email for demand of translattion from editor to admin when the editor edit some new content and not all. So I can't use the default trigger "content-publish-before".

I would like to known if it's possible to add a button on editing template of new content and run my worflow. If it's yes, in which /kernel/classes I can find some details to send email.

Cheers.

PS : I use ez 3.9

Stéphane

Stéphane Bullier

Wednesday 14 February 2007 11:59:44 pm

Hello,

Update ??

Not clear my question ?

Stéphane

Kristof Coomans

Thursday 15 February 2007 12:10:48 am

Hi Stéphane

Several classes used to send mail are located in lib/ezutils/classes.

You can find several examples of the usage of eZMail in the source code:

# find . -name "*.php" | xargs grep -il "ezmail"

There are also some extensions related to e-mail, take a look at the list on http://ezpedia.org/wiki/en/ez/e_mail

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Stéphane Bullier

Thursday 15 February 2007 12:38:32 am

Thank you Kristof for your reply.

Stéphane

*- pike

Friday 09 November 2007 4:14:12 am

I didn't tliterally test this, but it should be something like

include_once( "lib/ezutils/classes/ezmail.php" );
include_once( "lib/ezutils/classes/ezmailtransport.php" );

if (!eZMail::validate($sender) || !eZMail::validate($recipient)) {
   cry(); 
} else {
   $mail = new eZMail();
   $mail->setSender( $sender );
   $mail->setReceiver( $recipient );
   $mail->setSubject( $subject );
   $mail->setBody( $body );
   $mail->addBcc( $bcc );
   $mail->addExtraHeader("X-SpamLevel,"1000");
					
   if ( !eZMailTransport::send( $mail ) {
      cry(); 
   }
}

---------------
The class eZContentObjectTreeNode does.

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

eZ debug

Timing: Jan 19 2025 09:14:07
Script start
Timing: Jan 19 2025 09:14:07
Module start 'layout'
Timing: Jan 19 2025 09:14:07
Module start 'content'
Timing: Jan 19 2025 09:14:07
Module end 'content'
Timing: Jan 19 2025 09:14:07
Script end

Main resources:

Total runtime0.0169 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.2734152.6406
Module start 'layout' 0.00550.0027 741.914139.4766
Module start 'content' 0.00820.0064 781.390693.3672
Module end 'content' 0.01460.0022 874.757834.3047
Script end 0.0168  909.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002916.8691140.0002
Check MTime0.00158.5804140.0001
Mysql Total
Database connection0.00095.241210.0009
Mysqli_queries0.002213.198830.0007
Looping result0.00000.088810.0000
Template Total0.001810.910.0018
Template load0.00105.685010.0010
Template processing0.00095.211610.0009
Override
Cache load0.00074.071810.0007
General
dbfile0.00158.772080.0002
String conversion0.00000.040940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs