Welcome Guest, Not a member yet? Register   Sign In
Email Class and Templates
#1

[eluser]doubleplusgood[/eluser]
Hi there,

I know it's possible to load a view to send as an email. But I was wondering if it is possible to load a view, but to pass dynamic data to it?

As an example, I have built up a template view that has the tabled layout required to make the email look okay. But I'd like to pass things like data from form entries into the template.

Has anyone else tried anything like this?

Thanks,
Neil
#2

[eluser]OES[/eluser]
Hey Neil,

All you need to do is add TRUE to the view and save to a VAR

$message = $this->load->view('email', $data, TRUE);

// Then in your email ....

$this->email->message($message);
#3

[eluser]doubleplusgood[/eluser]
Thanks for the reply.

What I was also wondering is how to get the actual message to appear at a certain point in the template? Would i need to reference $message in the view template?
#4

[eluser]umefarooq[/eluser]
yes you have to do as it is you have to put $message reference in you variable as normal views




Theme © iAndrew 2016 - Forum software by © MyBB