[eluser]jmb727[/eluser]
Yeah create your email in one view file and your message body in another.
E.g.
Code:
class A_controller extends CI_Controller
{
public function __construct() {
parent::__construct();
}
public function index() {
//
}
public function createEmail($bodyVars)
{
$data = array();
$data['body'] = $this->load->view('email/body', $bodyVars, TRUE);
$this->load->view('email/layout', $data);
}
}
In the function
$this->load->view('email/body', $bodyVars, TRUE) the third argument is a boolean which determines whether the view file should be returned as a string or not. It defaults to FALSE which means it gets printed to the screen, however set it to TRUE and it will load the data you pass into it (i.e. $bodyVars) and return the view file into a variable.