Hi everyone, I'm trying to send out an email with html and plain text versions generated by templates. The email is getting created correctly, and sent out as intended, but the view in which I'd like to display the email sending results is blank.
My controller does something like:
function submitAction($vars_and_stuff){
$post = Models\Post::findFirst(23);
// do some stuff with post, save/update/etc
// send mail
$mail_result = $this->mail->sendMail($to, $from, $post);
}
My mail class is modeled after the Vokuro sample app Mail class. In the class I have:
private function _getTemplate(&$post, $template_name){
return $this->view->getRender('templates', $template_name, array('post'=>$post), function($view){
$view->setRenderLevel(View::LEVEL_LAYOUT);
});
return $view->getContent();
}
function sendMail($to, $from, &$post){
...
$html = $this->_getTemplate($post, 'emailHtml');
$plain = $this->_getTemplate($post, 'emailPlain');
...
}
So at the end of all of this, in my view, submit.volt, nothing shows up. Just a blank page. Can someone point out what I'm doing wrong? I'm guessing it has do do with view render levels or similar, but I keep ending up with the same blank page no matter what.
Thanks! -Seth