public function email($directory) { $game = $this->developer->games[$directory]; $email = isset($_POST['email']) ? $_POST['email'] : ''; $publication = isset($_POST['publication']) ? $_POST['publication'] : ''; ViewHelper::render('email_presscopy', array('game' => $game, 'email' => $email, 'publication' => $publication)); $body = ob_get_contents(); ob_end_clean(); $result = EmailHelper::send(EMAIL_SEND_TO, $_POST['email'], 'Request for Press Copy via presskit', $body); ob_start(); if ($result === true) { echo 'OK'; } else { echo $result; } ViewHelper::$template = 'ajax'; }