![]() |
Email template (view) : possible? how to? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Email template (view) : possible? how to? (/showthread.php?tid=23561) |
Email template (view) : possible? how to? - El Forum - 10-14-2009 [eluser]Scal[/eluser] Hi; is it possible to use a View as email template? Or do I have to create a file like a view and read the file content to set it as the email body value? Something like: $body = $>this->view->load('mytemplate', $data_array); $this->email->message($body); Or should I use "regular PHP" to: - open the 'mytemplate.php' file in read mode - store it locally - replace the parameter(s) with their actual values on the local variable - pass the local variable to the Email library message method Thanks for the feed back. Scal Email template (view) : possible? how to? - El Forum - 10-14-2009 [eluser]n0xie[/eluser] [quote author="Scal" date="1255561808"]Hi; is it possible to use a View as email template?[/quote] yes Email template (view) : possible? how to? - El Forum - 10-14-2009 [eluser]cahva[/eluser] "yes"... what kind of answer is that? ![]() Ok to the question. You almost had it(minus the syntax errors ![]() Code: $body = $this->load->view('mytemplate', $data_array, true); Email template (view) : possible? how to? - El Forum - 10-14-2009 [eluser]Scal[/eluser] Sweet; thanks guys for the answers. More specially to cahva as it was a bit more helpful ![]() Email template (view) : possible? how to? - El Forum - 10-14-2009 [eluser]n0xie[/eluser] [quote author="cahva" date="1255563009"]"yes"... what kind of answer is that? ![]() [/quote] The right one? ;-P [rant] The question was 'can I do {insert option here}'. The only answer to that is 'yes you can'. Explaining how would be pointless since he already came up with the solution, he just needed verification if it was 'correct'. Else the question would have been 'how do I {insert option here}'. I'm all for helping people, but most programmers are self taught (thus quite resourceful) and only need a nudge in the right direction to figure something out (which is half the fun of programming to begin with). Giving people spoonfed answers makes them less resourceful and contributes to the 'too lazy to google' syndrom. Teach a man to fish and all that. [/rant] Email template (view) : possible? how to? - El Forum - 10-14-2009 [eluser]wiredesignz[/eluser] @cahva, From about 500 - 1000 posts appears to be every forum member's smart ass phase. Email template (view) : possible? how to? - El Forum - 10-15-2009 [eluser]cahva[/eluser] [quote author="wiredesignz" date="1255583072"]@cahva, From about 500 - 1000 posts appears to be every forum member's smart ass phase.[/quote] ![]() Only ~360 posts to go and I'll go into smart-ass mode ![]() Email template (view) : possible? how to? - El Forum - 10-15-2009 [eluser]cahva[/eluser] @noxie: Im fisherman's friend also and all that. Atleast you could have do is tell that the solution is found in the manual. So the correct answer would have been: Yes. RTFM. ![]() Email template (view) : possible? how to? - El Forum - 10-15-2009 [eluser]Scal[/eluser] [quote author="cahva" date="1255620823"]So the correct answer would have been: Yes. RTFM. ![]() Amen to that as final note ![]() |