Welcome Guest, Not a member yet? Register   Sign In
Load view as body for email?
#1

[eluser]harmstra[/eluser]
Hi all,

I'm trying to send a html-email, wich content is loaded from a view

Code:
$content    = $this->load->view('v_usn_order_email',$data,true);
....
....
....

$this->email->message($content);

This works fine, but every time i send an email, a new browser screen opens.
Is there a way to avoid this?
#2

[eluser]Lone[/eluser]
The '$this->load->view()' section is loading the page not returning the data as you are expecting.

You need the save the content variable as a single string or you could just do an 'include()' to where the file with the content is located but you wont have the variables filled.
#3

[eluser]harmstra[/eluser]
That's why I load a view, I need the vars in the view.
Any ideas?
#4

[eluser]Sam Dark[/eluser]
Code:
$this->email->message($this->load->view('email/notification', $vars, true));
#5

[eluser]harmstra[/eluser]
mm, not sure why, but doesnt work for me

Solved it with some ajax




Theme © iAndrew 2016 - Forum software by © MyBB