diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index c021c482..8d242c31 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -302,22 +302,24 @@ class Admin_ReviewController extends Zend_Controller_Action $update = "update mdstatus set status=2 where uuid='$uuid'"; @$this->db->exec($update); } - $mailtp=new EmailText(); - $mailtp->db = $this->db; - $mailtp->tmpid = "expinvite"; - $mailtp->data = array( - 'user' => $expinfo['realname'], - 'uuid' => $uuid, - 'title' => $md['title'] + + $mailtp=new EmailText(); //实例化EmailText + $mailtp->db = $this->db; //传入PDO类型数据库对象 + $mailtp->tmpid = "expinvite"; //传入模板ID或标示符,传入ID是使用int类型 + $mailtp->data = array( //传入要替换的数据 + 'user' => $expinfo['realname'], //用户名 {user} + 'uuid' => $uuid, //uuid {uuid} + 'title' => $md['title'] //元数据标题 {title} ); - $body = $mailtp->loadtmp(); + $body = $mailtp->loadtmp(); //加载模板 + $subject = $mailtp->tmpinfo['subject']; //标题(顺序不能变,必须先加载模板后调用标题,减少数据库查询的次数) + if($body === false) { $this->messenger->addMessage('模板加载失败'); $this->_redirect("/admin/review/invite/?id=$id"); } - $subject = "西部数据中心-元数据评审邀请函"; $email = "la5c@qq.com"; $mail=new WestdcMailer($this->view->config->smtp); diff --git a/application/admin/views/scripts/sys/emailtext.phtml b/application/admin/views/scripts/sys/emailtext.phtml index a370570f..cde8ef09 100644 --- a/application/admin/views/scripts/sys/emailtext.phtml +++ b/application/admin/views/scripts/sys/emailtext.phtml @@ -2,10 +2,10 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); - $this->breadcrumb('后台首页'); - $this->breadcrumb('系统管理'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('系统管理'); $this->breadcrumb('邮件模板管理'); $this->breadcrumb()->setSeparator(' > '); ?> @@ -28,22 +28,23 @@ 创建新模板 + 查看邮件模板编写说明
模板标识 | -邮件主题 | -创建时间 | -更新时间 | +模板标识 | +邮件主题 | +创建时间 | +更新时间 | 操作 |
---|---|---|---|---|---|---|---|---|
- | - | + | + | + | 删除 | |