I am trying to load a template into an email using the Codeigniters email class, however I get it is black, can someone tell me why? Below is my code,
if($this->session->userdata('group_id') == '1') {
$data['key'] = $insertUser['activation_key'];
$data['name'] = $insertUser['name'];
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '*********',
'smtp_pass' => '********',
'mailtype' =>'html'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('no-reply@email.com', 'Email');
$this->email->to($insertUser['email']);
$this->email->subject('Your employers account');
$this->email->message($this->load->view('emails/signup', $data));
if (!$this->email->send())
show_error($this->email->print_debugger());
else
redirect('admin/users');
}
source
share