添加重通过功能,替换邮件模板为数据库

This commit is contained in:
wlx 2011-11-27 08:51:13 +00:00
parent 95b4949286
commit 66da794226
2 changed files with 9 additions and 11 deletions

View File

@ -93,17 +93,14 @@ class Admin_DownController extends Zend_Controller_Action
}
//发送用户邮件进行信息提示和说明
$mail = new WestdcMailer($this->view->config->smtp);
$body=file_get_contents($this->view->config->offline->email->finish_template);
$body=str_replace("[username]",$row['username'],$body);
$body=str_replace("[datalist]",str_replace(";","\n",$row['datalist']),$body);
$body=str_replace("[ftpuser]",$user->username,$body);
$body=str_replace("[ftppwd]",$proftp->pwd,$body);
$body=str_replace("[ftptime]",$proftp->time,$body);
$mail->setBodyText($body);
//实例化EmailText
$mailtp=new EmailText($this->db,'offline-finish',
array('user'=>$row['username'],'datalist'=>str_replace(";","\n",$row['datalist']),
'ftpuser'=>$user->username,'ftppwd'=>$proftp->pwd,'ftptime'=>$proftp->time));
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->addTo($row['email']);
$mail->setSubject('西部数据中心已开通了您的离线申请');
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setSubject($mailtp->getSubject());
$mail->send();
} //ftp1 deal
$this->messenger->addMessage('提示信息:该离线数据已经处理完成。');

View File

@ -52,7 +52,8 @@
<a href="/admin/down/offline/edit/<?= $item['id']; ?>">编辑</a> |
<a href="/admin/down/offline/delete/<?= $item['id']; ?>" title="该操作将删除此记录并且删除与此记录有关的申请记录!请谨慎操作" onclick="return confirm('请仅删除测试用途的离线服务记录!')">删除</a> |
<a href="/admin/down/offlineapp/view/<?= $item['id']; ?>">PDF</a> |
<a href="/admin/down/offline/show/<?= $item['id']; ?>">详细</a>
<a href="/admin/down/offline/show/<?= $item['id']; ?>">详细</a> |
<a href="/admin/down/offlineapp/finish/<?= $item['id']; ?>">重新通过</a>
</td>
</tr>
<?php endforeach; ?>