Commit 6dc2e49fc2c682e107dd030066b10a7ba3469d7c

Authored by Alex Savenko
1 parent 3b6bd2c7

generate letter

Showing 2 changed files with 8 additions and 8 deletions   Show diff stats
src/config/global.php
... ... @@ -379,6 +379,7 @@ return
379 379 'controllersDir' => 'app/tasks/',
380 380 'librariesDir' => 'lib/',
381 381 'modelsDir' => 'lib/models/',
  382 + 'viewsDir' => 'app/tasks/templates/',
382 383 ],
383 384 ],
384 385  
... ...
src/lib/sendmail.php
... ... @@ -300,14 +300,13 @@ namespace
300 300 'X-Mailer: PHP/' . phpversion();
301 301  
302 302 //msg body
303   -// $view = new \Phalcon\Mvc\View();
304   -// $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) );
305   -// $view->start();
306   -// $view->render( 'sendmail', 'message_10' );
307   -// $view->finish();
308   - $body = file_get_contents('/templates/abandoned_basket.php');
309   -
310   - if( mail( $email, $data_base['subject'], $body, $header, '-f '.$email_from ) ) {
  303 + $view = new \Phalcon\Mvc\View();
  304 + $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) );
  305 + $view->start();
  306 + $view->render( 'sendmail', 'abandoned_basket' );
  307 + $view->finish();
  308 +
  309 + if( mail( $email, $data_base['subject'], $view->getContent(), $header, '-f '.$email_from ) ) {
311 310 return true;
312 311 }
313 312 else {
... ...