/** * Send email $to with using the $template file in the * /app/view/email/ directory otherwise you changed {@link $viewDir} * @param $to * @param string $template Filename of template to use * @param string $subject Optional alternate subject that should be used * @param array(string) $data optional additional associated array data to render in the view * @return boolean true if mail was successfully send, otherwise false */ public function send($to, $template, $subject = null, $data = array()) { // use user logged in email for reply adress if ($this->controller->UserLogin->loggedin()) { $this->headers->set('Reply-To', $this->controller->UserLogin->User->get('email')); $this->headers->set('From', $this->controller->UserLogin->User->get('email')); } // render content $view = Library::create('ephFrame.lib.view.View', array($this->viewDir, $template, array_merge($this->controller->data->toArray(), $data))); $view->theme = $this->controller->theme; // send mail and return result return @mail($to, $subject == null ? $this->subject : $subject, $view->render(), $this->headers->implodef(RTLF, '%s: %s')); }
<?php /** * This is the application main script * * This is were everything about the application and the ephFrame Framework * is created. From the Request a dispatcher is initialized that creates * a controller from the url (if matched), that will create a view after * running the action that is requested and outputs this view as response. * * @package ephFrame * @author Marcel Eichner // Ephigenia <love@ephigenia.de * @since 03.12.2007 */ /** * load ephFrame */ require dirname(__FILE__) . '/ephFrame.php'; /** * Create the dispatcher that creates the controller ... which will * start the hole ephFrame MVC-Pattern. */ $dispatcher = Library::create('app.lib.AppDispatcher'); $dispatcher->dispatch(new HTTPRequest(true)); exit;