Strange behaviour occured when running twice this function below, for 2 different templates.
getRender doesn't poduct any content for the second template.
when calling: getTemplate(template1) and getTemplate(template2) -> I get results for template1 not for 2
when calling: getTemplate(template2) then getTemplate(template1) -> I get results for template2 not for 1
Any reason ?
Here is the code: got from Vokuro at Github in the class Mail (extends Component)
    public function getTemplate($name, $params)
    {
        $mailview = $this->view ;
            $content =  $mailview->getRender('emailTemplates', $name, $params, function($view){
                $view->setRenderLevel(View::LEVEL_AFTER_TEMPLATE);
            }); 
        return $content;
    }