Sending html email and using static template |
Hi guys
I'm sending html mail w/o any trouble, using email library Now, I'm need to add some design to the "newsletter" system I'm building with CI Which would be the best location to store images, css, etc. for the email template (relative?, absolute?) to be used within the email library, and how should I do to use and replace variables like {sender_name}, {sender_message} in the view (html template) Thanks a lot in advance
Enrique
https://beza.com.ar
I'd just create a view, and then use
PHP Code: $data['image1'] = 'some_image.jpg';
Being an email, the paths should be absolute. For the second problem, look at the great documentation: http://www.codeigniter.com/user_guide/li...email.html
Website: http://avenir.ro
Thanks guys!
All went fine. I loaded views with third param TRUE, put absolute paths, and all went great. I had trouble using TTL/SSL but solved by using smtp only, but I guess that's a problem from server
Enrique
https://beza.com.ar
$body contains the message and required the email-template.
Then you have to load the email library and the follwing to support HTML and send e-mail. $this->email->set_mailtype("html"); $this->email->initialize($config); $this->load->library('email'); $this->email->from('[email protected]', 'From Name'); $this->email->to('[email protected]'); $this->email->subject('Subject'); $this->email->message($body); $this->email->send(); |
Welcome Guest, Not a member yet? Register Sign In |