* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBEvent_Handler' , 'WBEvent_Handler_Shop' , 'WBEvent_Handler_Shop_Cart' , 'WBEvent_Handler_Mail' , 'WBShop' , 'WBShop_Cart' , 'patI18n'); /** * WBEvent_Handler_ITS_MailCustomer * * Send e-mail to customer * * @version 1.0.0 * @package Wombat * @subpackage base */ class WBEvent_Handler_Shop_Cart_MailTeam extends WBEvent_Handler_Shop_Cart { /** * Handler config * * For parameter list see parent class, additional parameter: * * @see WBEvent_Handler_Mail * @var array */ protected $config = array( 'from' => '', 'fromindex' => '', 'rcpt' => '', 'rcptindex' => 'email', 'addrcpt' => '', 'lang' => '', 'langindex' => '', 'tmpl' => 'email', 'eventuser' => 'uid', 'rcptgroup' => 'sales', 'loadcart' => 'id' ); /** * User object * @var WBUser */ private $user; /** * actually send e-mails * @var WBEvent_Handler_Mail */ private $mail; /** * Process event * * Send e-mail to sales team * * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { $data = $e->get(); $this->loadCart($e); $this->user = WBClass::create('WBUser'); if (!$this->user->load($data[$this->config['eventuser']])) { return true; } if ($this->user->isInGroup($this->config['rcptgroup'])) { return true; } $this->mergeCartData($e); $this->mail = WBClass::create('WBEvent_Handler_Mail'); $this->mail->setConfig($this->config); $this->mail->process($e); return true; } }