#291 将会员注册时的欢迎邮件功能改为由邮件模板发送

This commit is contained in:
Li Jianxuan 2011-12-28 08:27:07 +00:00
parent 94a10111b0
commit c8db5c4b56
1 changed files with 14 additions and 13 deletions

View File

@ -151,17 +151,20 @@ class AccountController extends Zend_Controller_Action
if($this->db->query($sql)) if($this->db->query($sql))
{ {
/* include_once('EmailText.php');
//发送欢迎邮件 $mailtp=new EmailText(
$mail=new WestdcMailer($this->view->config->smtp); $this->db,
$body=file_get_contents($this->view->config->register->email->template); 'member-sign-up',
$body=str_replace("[username]",$formData['username'],$body); array(
$mail->setBodyText($body); 'user' => $username,
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); )
$mail->addTo($formData['email']); );
$mail->setSubject('欢迎使用中国西部环境与生态数据中心'); @$mail=new WestdcMailer($this->view->config->smtp);
$mail->send(); @$mail->setBodyText($mailtp->getBody());
*/ @$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
@$mail->addTo($email);
@$mail->setSubject($mailtp->getSubject());
@$mail->send();
$this->login($username,md5($password)); $this->login($username,md5($password));
echo "<script>$('#info').html('Yor account has been successfully created!<br /><a href=\"\/\">Home page</a> <a href=\"\/account\/edit\">My account</a>')</script>"; echo "<script>$('#info').html('Yor account has been successfully created!<br /><a href=\"\/\">Home page</a> <a href=\"\/account\/edit\">My account</a>')</script>";
exit(); exit();
@ -176,8 +179,6 @@ class AccountController extends Zend_Controller_Action
exit(); exit();
} }
}//ajax 注册 }//ajax 注册
} }
function editAction() function editAction()
{ {