Domanda

i'm using codeigniter & ion auth. I'm having problem trying to send out email to user.

this is working:

$message = 'hello';
$this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));
$this->email->to($user->email);
$this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_forgotten_password_subject'));
$this->email->message($message);

when i change to use tpl, it is not working:
/views/forgot_password.tpl.php

$message = $this->load->view('forgot_password.tpl.php', $data, TRUE);
$this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));
$this->email->to($user->email);
$this->email->subject($this->config->item('site_title', 'ion_auth') . ' - ' . $this->lang->line('email_forgotten_password_subject'));
$this->email->message($message);

pls advise, thanks.

È stato utile?

Soluzione

Change "forgot_password.tpl.php" to "forgot_password.tpl" in your code:

$message = $this->load->view('forgot_password.tpl.php', $data, TRUE);

You don't need .php in $this->load->view().

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top