Exemplo n.º 1
0
 public function getProcessedTemplate(array $variables = array())
 {
     $processedResult = parent::getProcessedTemplate($variables);
     if ($this->_isTemplateConfidential()) {
         $this->getSentEmailModel()->setIsConfidential(true);
     } else {
         $this->getSentEmailModel()->setMailBody($processedResult);
     }
     return $processedResult;
 }
Exemplo n.º 2
0
 public function getProcessedTemplate(array $variables = array())
 {
     $html = parent::getProcessedTemplate($variables);
     if ($this->_viewPort) {
         $viewPortMetaTag = '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
         if (strpos($html, "<head>") !== false) {
             $html = str_replace("<head>", "<head>" . $viewPortMetaTag, $html);
         } else {
             $html = str_replace("<html>", "<html><head>" . $viewPortMetaTag . "</head>", $html);
         }
     }
     return $html;
 }
Exemplo n.º 3
0
 public function addMail(Mage_Core_Model_Email_Template $mailObject, $email, $name, $variables)
 {
     $emails = array_values((array) $email);
     $names = is_array($name) ? $name : (array) $name;
     $names = array_values($names);
     foreach ($emails as $key => $email) {
         if (!isset($names[$key])) {
             $names[$key] = substr($email, 0, strpos($email, '@'));
         }
     }
     $variables['email'] = reset($emails);
     $variables['name'] = reset($names);
     $mailObject->setUseAbsoluteLinks(true);
     $text = $mailObject->getProcessedTemplate($variables, true);
     if (empty($email)) {
         throw Mage::exception('Codex_Xtest', 'to is empty', Codex_Xtest_Exception::EMPTY_MAIL_RECIPIENT);
     }
     if (empty($text)) {
         throw Mage::exception('Codex_Xtest', 'body is empty', Codex_Xtest_Exception::EMPTY_MAIL_BODY);
     }
     self::$_mailqueue[] = array('variables' => $variables, 'emails' => $emails, 'body' => $text, 'object' => $mailObject);
     return $this;
 }
Exemplo n.º 4
0
 /**
  * @magentoAppIsolation enabled
  * @magentoDataFixture Mage/Core/_files/design_change.php
  */
 public function testGetProcessedTemplateDesignChange()
 {
     $this->_model->setTemplateText('{{view url="Mage_Page::favicon.ico"}}');
     $this->assertStringEndsWith('theme/frontend/default/modern/en_US/Mage_Page/favicon.ico', $this->_model->getProcessedTemplate());
 }