![]() |
Template parser and newsletters - 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: Template parser and newsletters (/showthread.php?tid=33489) |
Template parser and newsletters - El Forum - 08-27-2010 [eluser]Unknown[/eluser] HI all, I'm building a newsletter module and i need you advice ![]() Basically, newsletter's templates are selectables and edtable by the administrator with ckeditor. Newsletters and Templates are saved in a mysql table as html. Elements like {name}, {site_url}, {unsubscrib} {account} ...etc are parsed with the codeigniter template parser. But in this situaltion, the limitation of template parse class is it needs a view file, so not really 'out of the box' for html saved in a database. This is how i've managed to get it working: The controller who gets subscribers form model, and send mails: Code: // this function gets te whole newsletter object (subject, body...etc) and specfics data to parse finally, in the view file (newsletter_view.php) called by _parse_newsletter function, i simply echo $this->template property: Code: <?php Do you think we can do this in a simpliest way? i prefer use the native codeigniter class instead of writing new ones, and it's the 'best' way i found to send personnalized mails not templated in a php file. But maybe i'm on the wrong path... |