From c917ce2c230a2f891dbdbaa23db46cbe11567143 Mon Sep 17 00:00:00 2001
From: PavelBegunkov <asml.Silence@gmail.com>
Date: Tue, 23 Sep 2014 19:51:42 +0400
Subject: [PATCH] mail

---
 .../classes/Controller/Handler/ErrMessages.php   | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/~dev_rating/application/classes/Controller/Handler/ErrMessages.php b/~dev_rating/application/classes/Controller/Handler/ErrMessages.php
index 690fe429b..ab48ae0ad 100644
--- a/~dev_rating/application/classes/Controller/Handler/ErrMessages.php
+++ b/~dev_rating/application/classes/Controller/Handler/ErrMessages.php
@@ -28,11 +28,21 @@ class Controller_Handler_ErrMessages extends Controller_Handler {
          	$text = $_POST['text'];
             $result = $this->model->newRequest($this->user['AccID'], $title, $text);
 
-
             if ($result[0]['Num'] > 0) {
                 $to = "it.lab.mmcs@gmail.com";
-                $headers = "Reply-To: ".$this->user['AccEMail'];
-                $title = "Request ".$result[0]['Num'].": ".$title;
+                $subject =  "Request ".$result[0]['Num'].": rating system report"; 
+                
+                $message =  "Faculty: ".$this->user['FacultyName']."\n";
+                $message .= "Type: ".$this->user['AccType']."\n";
+                $message .= "Sender: ".$this->user['Last'].' '.$this->user['First'].' '.$this->user['Second']."\n";
+                $message .= "Title: ".$title."\n";
+                $message .= "Message: ".$text;
+
+                $headers =  "From: no-reply@rating.mmcs.sfedu.ru\n";
+                $headers .= "Reply-To: ".$this->user['AccEMail'];
+
+                echo Debug::vars($message, $headers, $title);
+
                 $data['success'] = true;
                 mail($to, $title, $text, $headers);
             }
-- 
GitLab