コード例 #1
0
ファイル: Model.php プロジェクト: cheevauva/trash
 public function restore($data)
 {
     $user = $this->getByEmail($data['email']);
     if (!empty($user)) {
         $this->mail->handleTemplate('restore.access', $user);
         $this->mail->to = $user['email'];
         $this->mail->send();
     }
 }
コード例 #2
0
ファイル: Model.php プロジェクト: cheevauva/trash
 public function restoreAccessByEmail($email)
 {
     $sql = $this->db->select()->from($this->table, array('email', 'username', 'password', 'id'))->where('email = ?', $email);
     $user = $this->db->fetchRow($sql);
     if ($user) {
         $attributes = $this->emailTemplate->getHandledTemplate('restore.access', array('user' => $user));
         $this->mail->setAttributes($attributes);
         $this->mail->send($user['email']);
         return true;
     }
     $this->addError('User with this email not found');
     return false;
 }