fix #268, send email to user and committies.
This commit is contained in:
parent
0e79c60824
commit
0390c991f9
|
@ -49,17 +49,32 @@ class Admin_DownController extends Zend_Controller_Action
|
|||
$mailtp=new EmailText($this->db,'offline-start',array('user'=>$row['username'],'datalist'=>$datalist));
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
//收件人邮箱
|
||||
$addrs = array(
|
||||
$row['email'],
|
||||
|
||||
);
|
||||
$mail->addTo($addrs);
|
||||
$mail->addTo($row['email']);
|
||||
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
|
||||
$mail->send();
|
||||
$sql="select distinct(res.email) from dataorder d left join role on d.uuid=role.uuid left join responsible res on role.resid=res.id where d.offlineappid=? and role.role in ('pointOfContact','resourceProvider')";
|
||||
$rows=$this->db->fetchAll($this->db->quoteInto($sql,$start));
|
||||
$addrs=array();
|
||||
foreach($rows as $row)
|
||||
{
|
||||
$addrs[]=$row['email'];
|
||||
}
|
||||
//收件人邮箱
|
||||
$addrs[] = 'nztong@lzb.ac.cn';
|
||||
$addrs[] = 'wjian@lzb.ac.cn';
|
||||
$addrs[] = 'lixin@lzb.ac.cn';
|
||||
|
||||
$mailtp=new EmailText($this->db,'offline-start-admin',array('user'=>$row['username'],'datalist'=>$datalist));
|
||||
$mail->setBodyText($mailtp->getBody());
|
||||
$mail->setSubject($mailtp->getSubject());
|
||||
$mail->addTo($addrs);
|
||||
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
|
||||
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/admin/down/offlineapp/view/'.$start);
|
||||
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
|
||||
$mail->send();
|
||||
|
||||
//提示信息
|
||||
$this->messenger->addMessage('提示信息:该离线数据已经开始处理,请在处理完成后点击“完成”。');
|
||||
$this->messenger->addMessage('提示信息:该离线数据已经开始处理,并发送邮件给申请人以及数据管理委员会,请在处理完成后点击“完成”。');
|
||||
$this->_redirect('/admin/down/offlineapp/'.$page);
|
||||
} elseif ($finish) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue