diff --git a/src/config/global.php b/src/config/global.php index 0a52edb..82e374b 100644 --- a/src/config/global.php +++ b/src/config/global.php @@ -379,6 +379,7 @@ return 'controllersDir' => 'app/tasks/', 'librariesDir' => 'lib/', 'modelsDir' => 'lib/models/', + 'viewsDir' => 'app/tasks/templates/', ], ], diff --git a/src/lib/sendmail.php b/src/lib/sendmail.php index adebdcb..b589dcb 100644 --- a/src/lib/sendmail.php +++ b/src/lib/sendmail.php @@ -300,14 +300,13 @@ namespace 'X-Mailer: PHP/' . phpversion(); //msg body -// $view = new \Phalcon\Mvc\View(); -// $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) ); -// $view->start(); -// $view->render( 'sendmail', 'message_10' ); -// $view->finish(); - $body = file_get_contents('/templates/abandoned_basket.php'); - - if( mail( $email, $data_base['subject'], $body, $header, '-f '.$email_from ) ) { + $view = new \Phalcon\Mvc\View(); + $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) ); + $view->start(); + $view->render( 'sendmail', 'abandoned_basket' ); + $view->finish(); + + if( mail( $email, $data_base['subject'], $view->getContent(), $header, '-f '.$email_from ) ) { return true; } else { -- libgit2 0.21.4