增加了邮件模板标题调用

emailtext视图微调
This commit is contained in:
Li Jianxuan 2011-10-13 09:11:35 +00:00
parent bd7392f5d1
commit 43434c27f2
2 changed files with 26 additions and 23 deletions

View File

@ -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);

View File

@ -28,6 +28,7 @@
<?php endif; ?>
<a class="" href="/admin/sys/emailtext/ac/add">创建新模板</a>
<a class="" href="/admin/sys/emailtext/ac/help">查看邮件模板编写说明</a>
<table><thead><tr>
<th>模板标识</th>
<th width="30%">邮件主题</th>