function invia_commento() { try { $nome = Params::get("nome"); $subject = Params::get("subject"); $email = Params::get("email"); $testo = Params::get("testo"); //$codice_hidden = Params::get("codice_hidden"); //$codice = Params::get("codice"); //if ($codice_hidden!=$codice) // throw new InvalidParameterException("Il codice non e' impostato correttamente!!"); if ($nome != null && $subject != null && $email != null && $testo != null && isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) { $e = new EMail("no_reply@" . Host::current_no_www(), Config::instance()->EMAIL_COMMENT_RECEIVED, "[Nuova commento da : " . $nome . "] - " . Host::current(), EMail::HTML_FORMAT); $e->render_and_send("include/messages/mail/alert/" . Lang::current() . "/nuovo_commento.php.inc", array("nome" => $nome, "email" => $email, "subject" => $subject, "testo" => $testo)); return Redirect::success(); } else { if (!isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) { throw new InvalidDataException("Il parametri di configurazione EMAIL_COMMENT_RECEIVED non e' impostato correttamente!!"); } else { throw new InvalidDataException("I dati immessi nella form non sono validi!!"); } } } catch (Exception $ex) { Flash::error($ex->getMessage()); return Redirect::failure(); } }
function send() { $success_message = Params::get("success_message"); $em = new EMail(Params::get("email"), Params::get("dest_address"), "Nuovo messaggio ricevuto", EMail::HTML_FORMAT); $vars = array("first_name" => Params::get("first_name"), "last_name" => Params::get("last_name"), "message" => Params::get("message")); $em->render_and_send("include/mail/message.php.inc", $vars); Flash::ok(Params::get($success_message)); return Redirect::success(); }
public static function alert($app_name, $alert_title) { $e = new EMail("alert@" . Host::current(), "*****@*****.**", "[" . $app_name . "] - " . $alert_title, EMail::HTML_FORMAT); $e->render_and_send("framework/core/messages/alert/alert.php.inc", array("app_name" => $app_name, "alert_title" => $alert_title)); }