Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezdefaultconfirmorderhandler.php
Go to the documentation of this file.
1 <?php
17 class eZDefaultConfirmOrderHandler
18 {
19 function execute( $params = array() )
20 {
21 $ini = eZINI::instance();
22 $sendOrderEmail = $ini->variable( 'ShopSettings', 'SendOrderEmail' );
23 if ( $sendOrderEmail == 'enabled' )
24 {
25 $this->sendOrderEmail( $params );
26 }
27 }
28
29 function sendOrderEmail( $params )
30 {
31 $ini = eZINI::instance();
32 if ( isset( $params['order'] ) and
33 isset( $params['email'] ) )
34 {
35 $order = $params['order'];
36 $email = $params['email'];
37
38 $tpl = eZTemplate::factory();
39 $tpl->setVariable( 'order', $order );
40 $templateResult = $tpl->fetch( 'design:shop/orderemail.tpl' );
41
42 $subject = $tpl->variable( 'subject' );
43
44 $mail = new eZMail();
45
46 $emailSender = $ini->variable( 'MailSettings', 'EmailSender' );
47 if ( !$emailSender )
48 $emailSender = $ini->variable( "MailSettings", "AdminEmail" );
49
50 if ( $tpl->hasVariable( 'content_type' ) )
51 $mail->setContentType( $tpl->variable( 'content_type' ) );
52
53 $mail->setReceiver( $email );
54 $mail->setSender( $emailSender );
55 $mail->setSubject( $subject );
56 $mail->setBody( $templateResult );
57 $mailResult = eZMailTransport::send( $mail );
58
59 $email = $ini->variable( 'MailSettings', 'AdminEmail' );
60
61 $mail = new eZMail();
62
63 if ( $tpl->hasVariable( 'content_type' ) )
64 $mail->setContentType( $tpl->variable( 'content_type' ) );
65
66 $mail->setReceiver( $email );
67 $mail->setSender( $emailSender );
68 $mail->setSubject( $subject );
69 $mail->setBody( $templateResult );
70 $mailResult = eZMailTransport::send( $mail );
71 }
72 }
73 }
74
75 ?>
eZDefaultConfirmOrderHandler
The class eZDefaultConfirmOrderHandler does.
Definition: ezdefaultconfirmorderhandler.php:18
eZDefaultConfirmOrderHandler\execute
execute( $params=array())
Definition: ezdefaultconfirmorderhandler.php:19
eZDefaultConfirmOrderHandler\sendOrderEmail
sendOrderEmail( $params)
Definition: ezdefaultconfirmorderhandler.php:29
eZMailTransport\send
static send(eZMail $mail)
Definition: ezmailtransport.php:32
eZMail
Mail handler.
Definition: ezmail.php:60
eZTemplate\factory
static factory()
Definition: eztemplate.php:2380
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.