/**
  * @param EmailInterface $email
  * @param string         $locale
  */
 public function getTemplatesPreview(EmailInterface $email, $locale)
 {
     $email->setLocale($locale);
     $this->renderer->loadTemplates($email);
     $this->renderer->setStrictVariables(false);
     $this->templates['fromName'] = $email->getFromName($this->defaultEmail);
     $this->templates['subject'] = $email->getSubject();
     $this->templates['content'] = $email->getBody();
     $this->errors = array('subject' => null, 'from_name' => null, 'html_content' => null);
     $suffix = $email->getChecksum();
     foreach ($this->errors as $template => $error) {
         try {
             $this->renderer->renderTemplate(sprintf('%s_%s', $template, $suffix));
         } catch (\Twig_Error $e) {
             $this->errors[$template] = $e->getRawMessage();
         }
     }
     $this->renderer->setStrictVariables(true);
 }