44 lines
848 B
PHP
44 lines
848 B
PHP
<?php
|
|
namespace Mail\Operation;
|
|
|
|
use Helpers\View as view;
|
|
use Helpers\dbh;
|
|
|
|
//事件中存在的操作
|
|
class MailOperate implements \Mail\Event\MailEvent
|
|
{
|
|
private $db; //传入PDO对象误
|
|
private $config; //全局配置
|
|
|
|
public $tbl_maillog = ""; //邮件日志表
|
|
|
|
function __construct($db = NULL)
|
|
{
|
|
if(empty($db))
|
|
{
|
|
$this->db = \Zend_Registry::get('db');
|
|
}else{
|
|
$this->db = $db;
|
|
}
|
|
|
|
$this->config = \Zend_Registry::get('config');
|
|
}
|
|
|
|
public function preSend(\Zend_EventManager_Event $e)
|
|
{
|
|
$email = $e->getParam('email');
|
|
|
|
return true;
|
|
}
|
|
|
|
public function mailSended(\Zend_EventManager_Event $e)
|
|
{
|
|
$email = $e->getParam('email');
|
|
$time = date("Y-m-d H:i:s");
|
|
$title = $e->getParam('title');
|
|
$content = $e->getParam('content');
|
|
|
|
return true;
|
|
}
|
|
|
|
} |