Check EmailComponent::__renderTemplate() On May 18, 4:48 pm, wrdevos <wrde...@gmail.com> wrote: > Hi, > > I have a mail layout, and two mail views (text and html). From my > controller I can render emails just fine with these three, BUT I want > to store the rendered emails in my mail queue in the database. > Therefore I would like to *grab* the rendered result and put it into a > variable before I write the mail queue record into the db. How is this > done? > > This is what I've came up with so far (controller code): > > function _mailHtml() { > // save the controller's layout temporarily > // while switching to the email layout > $store_layout = $this->layout; > $this->layout = 'email/html/default'; > > ob_start(); // start output buffering > $this->render('email_html'); > $rendered = ob_get_clean(); > > // set the controller's layout back to what it was > $this->layout = $store_layout; > return $rendered; > > } > > This does not work. The html mail gets rendered instead of the > controller action I want to render after I called this function, and > in an addition to that the $rendered return variable stays empty... > > I think I am missing something here. Could anyone point me in the > right direction, please? > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with > their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en