How to include email view as email message? |
[eluser]Christophe28[/eluser]
Hi, I would like to include the 'email/activate_html.php' view as message using the CI email class, but it doesn't work? My code: Code: // load email library When using this code the email message is empty and the view is being load on the 'success page' just after registration. However I saw the same solution in an other auth library: Code: function _send_email($type, $email, &$data) Any suggestions? Thx! Christophe
[eluser]umefarooq[/eluser]
hi check are you call right file name you want to include email/activate_html.php but in your code Code: $this->email->message($this->load->view('email/'.$type.'-html', $data, TRUE)); hope it will work
[eluser]Christophe28[/eluser]
Hi, No, I just gave the second portion of code as an example which worked. The first code block is my own code block which don't work. The view is set correct, but isn't send along with the email, but load after submitting the form ... Still working on it, but still haven't find a solution, so if anybody could help me out here, that would be great! Christophe
[eluser]markup2go[/eluser]
As umefarooq posted, when you use the loader class, particularly the view method, in your case you want to return a string so you would set the 3rd parameter to TRUE. This will return data as a string rather then rendering it to your browser. |
Welcome Guest, Not a member yet? Register Sign In |