From 43434c27f22e4d12f80a4e4fb4d61d2b093c7113 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 13 Oct 2011 09:11:35 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=A0=87=E9=A2=98=E8=B0=83=E7=94=A8=20emailt?= =?UTF-8?q?ext=E8=A7=86=E5=9B=BE=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 20 +++++++------ .../admin/views/scripts/sys/emailtext.phtml | 29 ++++++++++--------- 2 files changed, 26 insertions(+), 23 deletions(-) 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 @@ 创建新模板 + 查看邮件模板编写说明 - - - - + + + + -paginator)): - $autoindex=0; - foreach ($this->paginator as $item): +paginator)): + $autoindex=0; + foreach ($this->paginator as $item): $autoindex++;?> - - - + + +
模板标识邮件主题创建时间更新时间模板标识邮件主题创建时间更新时间 操作
删除 |