添加数据评审发布邮件通知

This commit is contained in:
wlx 2011-11-23 05:01:29 +00:00
parent a94865fccc
commit 55bcb51e46
1 changed files with 11 additions and 1 deletions

View File

@ -531,6 +531,16 @@ class Admin_ReviewController extends Zend_Controller_Action
if($this->changestatus($id,5)) if($this->changestatus($id,5))
{ {
$this->messenger->addMessage('操作成功:该元数据意见成功发布'); $this->messenger->addMessage('操作成功:该元数据意见成功发布');
//email message
$mail=new WestdcMailer($this->view->config->smtp);
$sql="select m.title,m.uuid,array_to_string(array(select distinct(email) from role r left join responsible rs on r.resid=rs.id where r.uuid=m.uuid and length(rs.email)>4),',') as emails from mdstatus s left join metadata m on s.uuid=m.uuid where s.id=?";
$res=$this->db->fetchRow($this->db->quoteInto($sql,$id));
$mailtp=new EmailText($this->db,'metadata-publish',array('uuid'=>$res['uuid'],'title'=>$res['title']));
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo(explode(',',$res['emails']));
$mail->setSubject($mailtp->getSubject());
$mail->send();
$this->_redirect("/admin/review/myreview"); $this->_redirect("/admin/review/myreview");
}else{ }else{
$this->messenger->addMessage('操作失败'); $this->messenger->addMessage('操作失败');