/** * Retrieve processed email body * * @return string */ public function getBodyHtml() { if (!$this->_bodyHtml) { $bodyHtml = $this->getMediumData('body_html'); // if no body html is set, render template if (!$bodyHtml) { $cacheKey = 'mzax_email_cache_' . $this->_content->getContentCacheId(); $bodyHtml = Mage::app()->loadCache($cacheKey); if (!$bodyHtml) { $template = $this->getTemplate(); $data = Zend_Json::decode($this->getMediumData('body')); $bodyHtml = $template->render($data); Mage::app()->saveCache($bodyHtml, $cacheKey, array(Mzax_Emarketing_Model_Campaign::CACHE_TAG)); } } // @TODO prepare template vars? $this->_bodyHtml = $this->filter->filter($bodyHtml); } return $this->_bodyHtml; }
/** * Set content * * @param Mzax_Emarketing_Model_Campaign_Content $content * @return Mzax_Emarketing_Model_Recipient */ public function setContent(Mzax_Emarketing_Model_Campaign_Content $content) { $this->_content = $content; if ($content) { $this->setVariationId((int) $content->getVariationId()); } return $this; }