/** * Generate the content text for this newsletter. * * @return string */ public function generateContentText($area) { if (!$this->theme instanceof AvisotaNewsletterTheme) { throw new Exception('A newsletter need a theme!'); } AvisotaStatic::pushNewsletter($this); $content = ''; if (isset($this->contentArray[$area])) { foreach ($this->contentArray[$area] as $element) { $content .= AvisotaNewsletterContent::getInstance()->generateNewsletterElement($element, NL_PLAIN); } } // reset static information AvisotaStatic::popNewsletter(); return $content; }