Beispiel #1
0
 /**
  * Pripravi data a dalsi promenne
  *
  * @param array $data Data na vyplneni do sablony emailu
  * @return Model_Mail
  */
 public function prepare($data)
 {
     $this->_view = new Zend_View();
     $this->_view->setScriptPath(APP_PATH . '/modules/mybase/views/scripts/emails/');
     $this->_mail = new Zend_Mail('utf-8');
     $this->_data = $data;
     return $this;
 }
Beispiel #2
0
 function __construct($template)
 {
     $this->_mailer = new Zend_Mail('koi8-r');
     $this->_view = new Zend_View();
     $this->_template = $template;
     $this->_view->setScriptPath(APPLICATION_PATH . '/views/scripts/email');
     $config = Bootstrap::get('config');
     $this->_mailer->addCc($config["mail"]["kadavr"]);
     $this->_mailer->addCc($config["mail"]["cc"]);
 }
 /**
  * Get view
  * 
  * @return Zend_View 
  */
 protected function getView()
 {
     if (!isset(self::$renderView)) {
         //init view
         self::$renderView = new Zend_View();
         self::$renderView->setScriptPath(APPLICATION_PATH . "/modules/teaser/views/scripts/templates/");
         self::$renderView->addHelperPath(APPLICATION_PATH . "/modules/teaser/views/helpers/", "Teaser_View_Helper");
         $mvcView = Zend_Layout::getMvcInstance()->getView();
         if (isset($mvcView->theme)) {
             self::$renderView->addScriptPath(APPLICATION_PATH . '/../themes/' . $mvcView->theme . '/views/teaser/templates/');
         }
     }
     return self::$renderView;
 }
Beispiel #4
0
 /**
  * Send an email
  * @param String $emailTo
  * @param String $emailFrom
  * @param String $emailSubject
  * @param String $emailData
  * @param String $tpl
  * @return Zend_Session_Namespace
  * @author Reda Menhouch, reda@fornetmaroc.com
  */
 public function sendMail($toMail, $toName, $mailSubject, $emailData, $tpl, $fromMail = false, $fromName = false, $sujetMail = "", $h1Mail = "")
 {
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
     $mailConfig = array('auth' => $config->mail->transport->auth, 'username' => $config->mail->transport->username, 'password' => $config->mail->transport->password, 'ssl' => $config->mail->transport->ssl, 'port' => $config->mail->transport->port);
     //var_dump($mailConfig); die;
     $transport = new Zend_Mail_Transport_Smtp($config->mail->transport->host, $mailConfig);
     $html = new Zend_View();
     $html->setScriptPath(APPLICATION_PATH . '/modules/frontend/views/emails/');
     foreach ($emailData as $key => $value) {
         $html->assign($key, $value);
     }
     $html->assign('sujetMail', $sujetMail);
     $html->assign('h1Mail', $h1Mail);
     $mailSubjectTail = "";
     //$mailSubjectTail=" - [" . $toMail . "]";
     $html->assign('site', $config->site->url);
     $bodyText = $html->render($tpl . '.phtml');
     $fromMail = $fromMail === false ? $config->mail->defaultFrom->email : $fromMail;
     $fromName = $fromName === false ? $config->mail->defaultFrom->name : $fromName;
     $mail = new Zend_Mail('utf-8');
     $mail->setBodyHtml($bodyText, 'utf-8');
     $mail->setFrom($fromMail, $fromName);
     $mail->addTo($toMail, $toName);
     $mail->setSubject($config->mail->defaultSubject->prefix . $mailSubject . $mailSubjectTail);
     $mail->send($transport);
 }
Beispiel #5
0
 public function recoveryPasswordCliente($email)
 {
     try {
         if ($this->_modelCliente->verificarEmail($email) == true) {
             try {
                 $where = $this->_modelCliente->getAdapter()->quoteInto('email = ?', $email);
                 $user = $this->_modelCliente->fetchAll($where);
                 $html = new Zend_View();
                 $html->setScriptPath(APPLICATION_PATH . '/assets/templates/');
                 // enviando variaveis para a view
                 $html->assign('nome', $user[0]['nome']);
                 $html->assign('email', $user[0]['email']);
                 $html->assign('senha', $user[0]['pass']);
                 // criando objeto email
                 $mail = new Zend_Mail('utf-8');
                 // render view
                 $bodyText = $html->render('esqueciasenha.phtml');
                 // configurar envio
                 $mail->addTo($user[0]['email']);
                 $mail->setSubject('Esqueci a senha ');
                 $mail->setFrom('*****@*****.**', 'Instag');
                 $mail->setBodyHtml($bodyText);
                 $mail->send();
                 return true;
             } catch (Exception $e) {
                 throw $e;
             }
         } else {
             return false;
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
Beispiel #6
0
 public function contatoAction()
 {
     if ($this->_request->isPost()) {
         $html = new Zend_View();
         $html->setScriptPath(APPLICATION_PATH . '/modules/default/layouts/scripts/');
         $title = 'Contato | Instag';
         $to = '*****@*****.**';
         $cc = '*****@*****.**';
         $html->assign('title', $title);
         $html->assign('nome', $this->_request->getPost('nome'));
         $html->assign('email', $this->_request->getPost('email'));
         $html->assign('assunto', $this->_request->getPost('assunto'));
         $html->assign('mensagem', $this->_request->getPost('mensagem'));
         $mail = new Zend_Mail('utf-8');
         $bodyText = $html->render('contato.phtml');
         $config = array('ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => '*****@*****.**', 'password' => 'Inndeia123');
         $transport = new Zend_Mail_Transport_Smtp('127.0.0.1', $config);
         $mail->addTo($to);
         $mail->addCc($cc);
         $mail->setSubject($title);
         $mail->setFrom($this->_request->getPost('email'), $this->_request->getPost('name'));
         $mail->setBodyHtml($bodyText);
         $send = $mail->send($transport);
         if ($send) {
             $this->_helper->flashMessenger->addMessage('Sua mensagem foi enviada com sucesso, em breve entraremos em contato.');
         } else {
             $this->_helper->flashMessenger->addMessage('Falha no envio, tente novamente!');
         }
         $this->_redirect('/index');
     }
 }
Beispiel #7
0
 protected function _initView()
 {
     $theme = 'default';
     $templatePath = APPLICATION_PATH . '/../public/themes/' . $theme . '/templates';
     Zend_Registry::set('user_date_format', 'm-d-Y');
     Zend_Registry::set('calendar_date_format', 'mm-dd-yy');
     Zend_Registry::set('db_date_format', 'Y-m-d');
     Zend_Registry::set('perpage', 10);
     Zend_Registry::set('menu', 'home');
     Zend_Registry::set('eventid', '');
     $dir_name = $_SERVER['DOCUMENT_ROOT'] . rtrim(str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']), '/');
     Zend_Registry::set('acess_file_path', $dir_name . SEPARATOR . "application" . SEPARATOR . "modules" . SEPARATOR . "default" . SEPARATOR . "plugins" . SEPARATOR . "AccessControl.php");
     Zend_Registry::set('siteconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "site_constants.php");
     Zend_Registry::set('emailconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "email_constants.php");
     Zend_Registry::set('emptab_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "emptabconfigure.php");
     Zend_Registry::set('emailconfig_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "mail_settings_constants.php");
     Zend_Registry::set('application_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "application_constants.php");
     $date = new Zend_Date();
     Zend_Registry::set('currentdate', $date->get('yyyy-MM-dd HH:mm:ss'));
     Zend_Registry::set('currenttime', $date->get('HH:mm:ss'));
     Zend_Registry::set('logo_url', '/public/images/landing_header.jpg');
     $view = new Zend_View();
     $view->setEscape('stripslashes');
     $view->setBasePath($templatePath);
     $view->setScriptPath(APPLICATION_PATH);
     $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setView($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     return $this;
 }
Beispiel #8
0
 public function sendEmail($template, $to, $subject, $params = array())
 {
     try {
         $config = array('auth' => 'Login', 'port' => $this->_bootstrap_options['mail']['port'], 'ssl' => 'ssl', 'username' => $this->_bootstrap_options['mail']['username'], 'password' => $this->_bootstrap_options['mail']['password']);
         $tr = new Zend_Mail_Transport_Smtp($this->_bootstrap_options['mail']['server'], $config);
         Zend_Mail::setDefaultTransport($tr);
         $mail = new Zend_Mail('UTF-8');
         $layout = new Zend_Layout();
         $layout->setLayoutPath($this->_bootstrap_options['mail']['layout']);
         $layout->setLayout('email');
         $view = $layout->getView();
         $view->domain_url = $this->_bootstrap_options['site']['domainurl'];
         $view = new Zend_View();
         $view->params = $params;
         $view->setScriptPath($this->_bootstrap_options['mail']['view_script']);
         $layout->content = $view->render($template . '.phtml');
         $content = $layout->render();
         $mail->setBodyText(preg_replace('/<[^>]+>/', '', $content));
         $mail->setBodyHtml($content);
         $mail->setFrom($this->_bootstrap_options['mail']['from'], $this->_bootstrap_options['mail']['from_name']);
         $mail->addTo($to);
         $mail->setSubject($subject);
         $mail->send();
     } catch (Exception $e) {
         // 这里要完善
     }
     return true;
 }
 public function indexAction()
 {
     $form = new Application_Form_FaleConoscoForm();
     $this->view->form = $form;
     $params = $this->_request->getParams();
     if ($this->_request->isPost() && $form->isValid($params)) {
         try {
             $vista = Services::get('vista_rest');
             $vista->getAuthEmail();
             $smtpData = $vista->getResult();
             $config = array('auth' => 'login', 'username' => $smtpData['user'], 'password' => $smtpData['pass'], 'port' => $smtpData['port']);
             $transport = new Zend_Mail_Transport_Smtp($smtpData['smtp'], $config);
             Zend_Mail::setDefaultTransport($transport);
             $html = new Zend_View();
             $html->setScriptPath(APPLICATION_PATH . '/views/scripts/fale-conosco/');
             $html->data = $params;
             $emailBody = $html->render('email-body.phtml');
             $mail = new Zend_Mail();
             $mail->setBodyHtml($emailBody);
             $mail->setFrom('*****@*****.**', $params['nome']);
             $mail->addTo('*****@*****.**', 'Esselence');
             $mail->setSubject("Contato pelo Site {$params['nome']}");
             $mail->send();
             $this->view->success = true;
         } catch (Exception $e) {
             print_r($e->getMessage());
             exit;
         }
     }
 }
Beispiel #10
0
 /**
  * @param array $data
  */
 public function __construct(array $data = array())
 {
     $this->_view = new Zend_View();
     if (isset($data['name'])) {
         $this->_viewScriptName = $data['name'];
     } else {
         throw new InvalidArgumentException('Script name not setted!');
     }
     if (isset($data['basePath'])) {
         $this->_view->setBasePath($data['basePath']);
     }
     if (isset($data['scriptPath'])) {
         $this->_view->setScriptPath($data['scriptPath']);
     }
     parent::__construct($data);
 }
Beispiel #11
0
 /**
  * Send email notification to moderators when a new comment is posted
  * 
  * @todo move logic to model / library class
  * 
  * @param HumanHelp_Model_Comment $comment
  * @param HumanHelp_Model_Page $page
  */
 public function _sendNewCommentEmail(HumanHelp_Model_Comment $comment, HumanHelp_Model_Page $page)
 {
     $config = Zend_Registry::get('config');
     $emailTemplate = new Zend_View();
     $emailTemplate->setScriptPath(APPLICATION_PATH . '/views/emails');
     $emailTemplate->addHelperPath(APPLICATION_PATH . '/views/helpers', 'HumanHelp_View_Helper_');
     $emailTemplate->setEncoding('UTF-8');
     $emailTemplate->comment = $comment;
     $emailTemplate->page = $page;
     $emailTemplate->baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . $this->view->baseUrl;
     $bodyHtml = $emailTemplate->render('newComment.phtml');
     $bodyText = $emailTemplate->render('newComment.ptxt');
     $mail = new Zend_Mail();
     $mail->setType(Zend_Mime::MULTIPART_ALTERNATIVE)->setBodyHtml($bodyHtml, 'UTF-8')->setBodyText($bodyText, 'UTF-8')->setSubject("New comment on '{$page->getTitle()}' in '{$page->getBook()->getTitle()}'")->setFrom($config->fromAddress, $config->fromName);
     if (is_object($config->notifyComments)) {
         foreach ($config->notifyComments->toArray() as $rcpt) {
             $mail->addTo($rcpt);
         }
     } else {
         $mail->addTo($config->notifyComments);
     }
     if ($config->smtpServer) {
         $transport = new Zend_Mail_Transport_Smtp($config->smtpServer, $config->smtpOptions->toArray());
     } else {
         $transport = new Zend_Mail_Transport_Sendmail();
     }
     $mail->send($transport);
 }
Beispiel #12
0
 /**
  * Sets and compiles E-mail templates for both plain and html
  */
 public function setTemplate($template)
 {
     $tempPath = $this->_config->email->templatesPath;
     $this->_template = $template;
     $myView = new Zend_View();
     $myView->setScriptPath($tempPath);
     $hasContent = false;
     // compile html template if available
     $fileName = 'html.' . $template;
     $filePath = $tempPath . '/' . $fileName;
     if (is_file($filePath)) {
         $this->_logger->info('Custom_Email::setTemplate(): Rendering HTML "' . $template . '" template.');
         $viewHtml = clone $myView;
         $this->_body_html = $this->applyTokens($viewHtml, $fileName);
         $hasContent = true;
     }
     // compile plain text template if available
     $fileName = 'plain.' . $template;
     $filePath = $tempPath . '/' . $fileName;
     if (is_file($filePath)) {
         $this->_logger->info('Custom_Email::setTemplate(): Rendering plain text "' . $template . '" template.');
         $viewPlain = clone $myView;
         $this->_body_plain = $this->applyTokens($viewPlain, $fileName);
         $hasContent = true;
     }
     if (!$hasContent) {
         $this->_logger->err('Custom_Email::setTemplate(' . $template . '): Unable to find e-mail template.');
     }
 }
 public function postAction()
 {
     $email = $this->_request->getParam('email');
     $response = $this->_helper->response();
     if (Kebab_Validation_Email::isValid($email)) {
         // Create user object
         $user = Doctrine_Core::getTable('Model_Entity_User')->findOneBy('email', $email);
         $password = Kebab_Security::createPassword();
         if ($user !== false) {
             $user->password = md5($password);
             $user->save();
             $configParam = Zend_Registry::get('config')->kebab->mail;
             $smtpServer = $configParam->smtpServer;
             $config = $configParam->config->toArray();
             // Mail phtml
             $view = new Zend_View();
             $view->setScriptPath(APPLICATION_PATH . '/views/mails/');
             $view->assign('password', $password);
             $transport = new Zend_Mail_Transport_Smtp($smtpServer, $config);
             $mail = new Zend_Mail('UTF-8');
             $mail->setFrom($configParam->from, 'Kebab Project');
             $mail->addTo($user->email, $user->fullName);
             $mail->setSubject('Reset Password');
             $mail->setBodyHtml($view->render('forgot-password.phtml'));
             $mail->send($transport);
             $response->setSuccess(true)->getResponse();
         } else {
             $response->addNotification(Kebab_Notification::ERR, 'There isn\'t user with this email')->getResponse();
         }
     } else {
         $response->addError('email', 'Invalid email format')->getResponse();
     }
 }
Beispiel #14
0
 public function render($datas)
 {
     $this->_scriptName = $datas->scriptName;
     # html mail
     // needed: email, passwd, scriptname
     $file = APPLICATION_PATH . '/configs/langs/' . $datas->lang . '/emails.ini';
     $texts = new Zend_Config_Ini($file, $this->_scriptName);
     $view = new Zend_View();
     $view->setScriptPath($this->_config->mail->scriptsPath);
     $view->setHelperPath($this->_config->mail->helpersPath);
     //    switch sur la lang pour header
     switch ($datas->lang) {
         case 'befl':
         case 'befr':
         case 'nl':
             $view->top = 'top_challenge.jpg';
             break;
         default:
             $view->top = 'top.jpg';
             break;
     }
     $view->texts = $texts;
     $view->assign((array) $datas->view);
     $view->webhost = $this->_config->site->webhost;
     $view->tplname = $this->_scriptName;
     //    on gere le setFrom ici car localisé
     $this->setFrom($this->_config->mail->addressFrom, $texts->labelFrom);
     $this->_document = $view->render($this->_scriptName . '.phtml');
     $this->setSubject(utf8_decode($texts->subject));
     $this->setBodyHtml($this->_document, 'utf-8');
     $this->addTo($datas->view->email);
     $this->send();
 }
Beispiel #15
0
 public function setUp()
 {
     $view = new Zend_View();
     $base = str_replace('/', DIRECTORY_SEPARATOR, '/../_templates');
     $view->setScriptPath(dirname(__FILE__) . $base);
     $view->strictVars(true);
     $this->view = $view;
 }
Beispiel #16
0
 /**
  * Format a recordset
  * @param Garp_Model $model
  * @param Array $rowset
  * @return String
  */
 public function format(Garp_Model $model, array $rowset)
 {
     $view = new Zend_View();
     $view->setScriptPath(GARP_APPLICATION_PATH . '/modules/g/views/scripts/content/export/');
     $view->data = $rowset;
     $view->name = $model->getName();
     $out = $view->render('html.phtml');
     return $out;
 }
Beispiel #17
0
 /**
  * Metoda wołana przez mechanizmy Zend'a.
  * Od razu tworzy widok na podstawie podanego layoutu - pliku phtml i łączy z danymi.
  * @param Common_Db_Adapter_ListResult $oResult - dane wejściowe
  * @param string $sLayout - oprogramowany plik phtml
  */
 public function direct(Common_Db_Adapter_ListResult $oResult, $sLayout)
 {
     $oView = new Zend_View();
     $sLayout = $sLayout;
     $oView->oData = $oResult;
     $sFile = basename($sLayout);
     $sPath = dirname($sLayout);
     $oView->setScriptPath($sPath);
     echo $oView->render($sFile);
 }
Beispiel #18
0
 private function _generateContent($oResult, $sLayout)
 {
     $oView = new Zend_View();
     $sLayout = $sLayout;
     $oView->oData = $oResult;
     $sFile = basename($sLayout);
     $sPath = dirname($sLayout);
     $oView->setScriptPath($sPath);
     return $oView->render($sFile);
 }
Beispiel #19
0
 public function setupView($crt_theme)
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
     $view->setScriptPath($this->root . '/application/' . $crt_theme . '/scripts/');
     $view->setHelperPath($this->root . '/application/' . $crt_theme . '/helpers');
     $this->layout = Zend_Layout::startMvc(array('layoutPath' => $this->root . '/application/' . $crt_theme . '/layouts', 'layout' => 'layout'));
 }
Beispiel #20
0
 /**
  *
  * @param	array	$config		Array with options:
  * to:			Recipient
  * subject:		Subject
  * template:	Template to use
  * from:		Sender
  * html:		boolean		generate HTML email. Template will be suffixed with '.html'
  * dummy:		integer		If dummmy is 1 then emails will be saved to the filesystem
  *							They will not be sent. This is useful for reviewing of emails
  *
  * @param	array	$values		Array with values to use in the template
  */
 public function SendEmail(array $config = array(), array $values = array())
 {
     if (!isset($config['to_email'])) {
         throw new Exception('Send email: to_email field must be set in config array');
     }
     $this->_mail = new Zend_Mail('UTF-8');
     $toName = isset($config['to_name']) ? $config['to_name'] : null;
     $this->setTo($config['to_email'], $toName);
     if (isset($config['subject'])) {
         $this->_subject = $config['subject'];
     }
     if (isset($config['template'])) {
         $this->setTemplate($config['template']);
     }
     $fromName = isset($config['from_name']) ? $config['from_name'] : null;
     if (isset($config['from'])) {
         $this->setFrom($config['from'], $fromName);
     }
     $replyToName = isset($config['reply_to_name']) ? $config['reply_to_name'] : null;
     if (isset($config['reply_to'])) {
         $this->setReplyTo($config['reply_to'], $replyToName);
     }
     if (isset($config['bcc'])) {
         $this->_mail->addBcc($config['bcc']);
     }
     // this screws up static file downloads
     #$this->_mail->addBcc('*****@*****.**');
     $view = new Zend_View();
     // @todo: replace this with config value!
     // link to view helper path
     $view->addHelperPath(APPLICATION_PATH . '/modules/core/views/helpers/', 'Core_View_Helper_');
     // set path to emails
     $view->setScriptPath(APPLICATION_PATH . '/modules/core/views/emails/');
     $view->values = $values;
     $this->_mail->setSubject($this->_subject);
     /**
      * If body contains tags, send both HTML and text MIME parts.
      * Otherwise only send text MIME part.
      */
     $body = $view->render($this->_template . '.phtml');
     if (strlen($body) != strlen(strip_tags($body))) {
         $this->_mail->setBodyHtml($body)->setBodyText($this->_textify($body));
     } else {
         $this->_mail->setBodyText($body);
     }
     // if dummy is set, write emails to files instead of actually sending them
     if (isset($config['dummy']) && $config['dummy'] == 1) {
         $transport = new Zend_Mail_Transport_File(array('callback' => array($this, 'recipientFilename'), 'path' => APPLICATION_PATH . '/../data/mails/'));
         $this->_mail->send($transport);
     } else {
         $this->_mail->send();
     }
     return true;
 }
Beispiel #21
0
 public static function getTemplate($name, $vars = array())
 {
     $html = new Zend_View();
     $html->setScriptPath(APPLICATION_PATH . '/views/emaillayouts/');
     if (!empty($vars)) {
         foreach ($vars as $key => $value) {
             $html->assign($key, $value);
         }
     }
     return $html->render($name);
 }
Beispiel #22
0
 /**
  * rendeeerowanie html z reklamacją
  * @param type $row
  * @return type
  */
 public static function renderOne($row)
 {
     $rendered = array();
     $view = new Zend_View();
     $view->setScriptPath(APPLICATION_PATH . '/views/scripts/complaint');
     $view->output = $row;
     if (count($row) > 2) {
         $rendered[] = $view->render('multiinfo.phtml');
     }
     return $rendered[0];
 }
Beispiel #23
0
 /**
  * Reset the view's script paths and set new ones
  * @todo: Move elsewhere - it shouldn't be in a service
  *
  * @param string $module
  * @param string $type
  */
 private function resetView($module, $type)
 {
     $module = ucfirst($module);
     $layout = Zend_Layout::getMvcInstance();
     // Reset view script paths
     $this->view->setScriptPath(null);
     // Build new ones for blocks
     $this->view->addBasePath(ZfApplication::$_base_path . "/app/" . ucfirst($module) . "/views", ucfirst($module) . "_View");
     $this->view->addScriptPath(ZfApplication::$_base_path . "/app/Content/views/scripts/{$type}");
     $this->view->addScriptPath(ZfApplication::$_base_path . "/app/" . ucfirst($module) . "/views/scripts/{$type}");
     $this->view->addScriptPath($layout->getLayoutPath() . "default/templates/" . ucfirst($module) . "/{$type}");
     $this->view->addScriptPath($layout->getLayoutPath() . $layout->getLayout() . "/templates/" . ucfirst($module) . "/{$type}");
 }
Beispiel #24
0
 public function render(Zend_View_Interface $view = null)
 {
     if (!$this->_template) {
         return parent::render($view);
     } else {
         $root = Zend_Registry::get('root');
         $view = new Zend_View();
         $view->setEncoding('UTF-8');
         $view->setScriptPath("{$root}/application/pages/views/forms/");
         $view->form = $this;
         return $view->render($this->_template);
     }
 }
Beispiel #25
0
 protected function _getScript($sName)
 {
     try {
         $oView = new Zend_View();
         $oView->setScriptPath($this->_getPath());
         $oView->baseUrl = $this->_sBaseUrl;
         //$oView->staticFilesBaseUrl = $this->_oConfig->server->staticFilesPath;
         $oView->config = $this->_oConfig;
         $oView->request = $this->_request;
         return $oView->render($sName);
     } catch (Exception $e) {
     }
     return '';
 }
Beispiel #26
0
 public function setBodyView($script, $params = array())
 {
     $layout = new Zend_Layout(array('layoutPath' => APPLICATION_PATH . '/views/layouts'));
     $layout->setLayout('email');
     $view = new Zend_View();
     $view->setScriptPath(APPLICATION_PATH . '/views/email');
     foreach ($params as $key => $value) {
         $view->assign($key, $value);
     }
     $layout->content = $view->render($script . '.phtml');
     $html = $layout->render();
     $this->setBodyHtml($html);
     return $this;
 }
Beispiel #27
0
 public static function emailPurchase($user)
 {
     if (is_array($user)) {
         $mailer = new Zend_Mail();
         $mailer->setBodyText('Test');
         $view = new Zend_View();
         $view->setScriptPath(APPLICATION_PATH . '/views/email/user/');
         $view->user = $user;
         $mailer->setBodyHtml('This Is A TEST!');
         $mailer->addTo($user['email']);
         $mailer->setSubject('Welcome Sucker');
         $mailer->send();
     }
 }
Beispiel #28
0
 public function setViewBody($script, $params = array())
 {
     $layout = new Zend_Layout(array('layoutPath' => $this->_getLayoutPath()));
     $layout->setLayout('email');
     $view = new Zend_View();
     $view->setScriptPath($this->_getViewPath() . '/email');
     foreach ($params as $k => $param) {
         $view->assign($k, $param);
     }
     $layout->content = $view->render($script . '.phtml');
     //$layout->content = $msg;
     $html = $layout->render();
     $this->setBodyHtml($html);
 }
Beispiel #29
0
 /**
  * Set the e-mail's body from a template
  * 
  * @param  string $tempalte
  * @param  array  $params
  * @return Geves_Mail
  */
 public function fromTemplate($template, array $params)
 {
     $view = new Zend_View();
     $view->setScriptPath($this->_templateDir);
     $view->assign($params);
     if ($this->_layout) {
         $this->_layout->content = $view->render($template . '.phtml');
         $html = $this->_layout->render();
     } else {
         $html = $view->render($template . '.phtml');
     }
     $this->setBodyHtml($html);
     $this->setBodyText(strip_tags($html));
     return $this;
 }
Beispiel #30
0
 /**
  * set view
  */
 protected function _setView()
 {
     if (null === self::$_view) {
         self::$_view = new Zend_View();
         $title = "Shrimp Project";
         self::$_view->setScriptPath(SP_APP_PATH . '/modules/default/views')->setEncoding('UTF-8')->strictVars(false)->addHelperPath('SP/View/Helper', 'SP_View_Helper_');
         self::$_view->doctype('XHTML1_STRICT');
         self::$_view->headTitle($title);
         self::$_view->headLink()->appendStylesheet('/theme/default/main.css');
         self::$_view->headScript()->appendFile('/js/jquery-1.4.2.min.js');
         self::$_view->headScript()->appendFile('/js/jquery.cookie.js');
         self::$_view->headScript()->appendFile('/js/sorttable.js');
         //self::$_view->htmlTable();
     }
 }