fixed get_instance()
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
class RequestPassword {
|
||||
|
||||
private $ci;
|
||||
private $salt;
|
||||
private $user;
|
||||
private $password;
|
||||
@@ -18,12 +17,8 @@ class RequestPassword {
|
||||
|
||||
public function __construct( $user )
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
|
||||
$this->user = $user;
|
||||
|
||||
$this->ci->load->library( 'email' );
|
||||
|
||||
$this->handle();
|
||||
}
|
||||
|
||||
@@ -87,18 +82,21 @@ class RequestPassword {
|
||||
'password' => $this->password
|
||||
];
|
||||
|
||||
$html = $this->ci->load->view( 'emails/requestpassword_email', ['user'=>$data], true );
|
||||
$html = view('emails/requestpassword_email', ['user' => $data]);
|
||||
|
||||
$this->ci->email->from( 'noreply@dbois.nl', 'DBOIS' );
|
||||
$this->ci->email->to( $this->user->email );
|
||||
$this->ci->email->subject( 'Nieuw wachtwoord DBOIS' );
|
||||
$this->ci->email->message( $html );
|
||||
$this->ci->email->set_mailtype("html");
|
||||
$this->ci->email->set_newline("\r\n");
|
||||
$email = \Config\Services::email();
|
||||
$email->setFrom('noreply@dbois.nl', 'DBOIS');
|
||||
$email->setTo($this->user->email);
|
||||
$email->setSubject('Nieuw wachtwoord DBOIS');
|
||||
$email->setMessage($html);
|
||||
$email->setMailType('html');
|
||||
$email->setNewline("\r\n");
|
||||
|
||||
$this->sendResult = $this->ci->email->send();
|
||||
$this->sendResult = $email->send();
|
||||
|
||||
if( ! $this->sendResult ) log_message( 'error', json_encode($this->ci->email->print_debugger()));
|
||||
if (! $this->sendResult) {
|
||||
log_message('error', $email->printDebugger());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user