Commit e09cb6c225e67077ec7286491e4ce51656a28db3
1 parent
bada6a89
-Mail fixed
Showing
4 changed files
with
16 additions
and
6 deletions
Show diff stats
common/config/mail.php
@@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
2 | 2 | ||
3 | return [ | 3 | return [ |
4 | 1 => [ | 4 | 1 => [ |
5 | - 'host' => '', | ||
6 | - 'user' => '', | ||
7 | - 'pass' => '', | 5 | + 'host' => 'smtp.gmail.com', |
6 | + 'user' => 'kennen.md@gmail.com', | ||
7 | + 'pass' => 'nobeernoparty', | ||
8 | 'id' => 1, | 8 | 'id' => 1, |
9 | ], | 9 | ], |
10 | ]; | 10 | ]; |
11 | \ No newline at end of file | 11 | \ No newline at end of file |
@@ -5,7 +5,7 @@ return [ | @@ -5,7 +5,7 @@ return [ | ||
5 | 'phone' => '+38 (044) 593-73-76', | 5 | 'phone' => '+38 (044) 593-73-76', |
6 | 'phone2' => '+38 (098) 468-07-64', | 6 | 'phone2' => '+38 (098) 468-07-64', |
7 | 'skype' => 'artwebstudio', | 7 | 'skype' => 'artwebstudio', |
8 | - 'email' => '', | 8 | + 'email' => 'kennen.md@gmail.com', |
9 | 'house' => '1-М', | 9 | 'house' => '1-М', |
10 | 'street' => 'пр. М. Бажана', | 10 | 'street' => 'пр. М. Бажана', |
11 | 'office' => '25', | 11 | 'office' => '25', |
common/models/Order.php
@@ -20,6 +20,8 @@ use artbox\core\models\Feedback; | @@ -20,6 +20,8 @@ use artbox\core\models\Feedback; | ||
20 | */ | 20 | */ |
21 | class Order extends Feedback | 21 | class Order extends Feedback |
22 | { | 22 | { |
23 | + const SCENARIO_ORDER = 'order'; | ||
24 | + | ||
23 | public function rules() | 25 | public function rules() |
24 | { | 26 | { |
25 | return array_merge(parent::rules(), [ | 27 | return array_merge(parent::rules(), [ |
@@ -32,6 +34,14 @@ class Order extends Feedback | @@ -32,6 +34,14 @@ class Order extends Feedback | ||
32 | 34 | ||
33 | public function scenarios() | 35 | public function scenarios() |
34 | { | 36 | { |
35 | - return []; | 37 | + return |
38 | + [ | ||
39 | + self::SCENARIO_ORDER => [ | ||
40 | + 'name', | ||
41 | + 'email', | ||
42 | + 'message', | ||
43 | + 'subject', | ||
44 | + ], | ||
45 | + ]; | ||
36 | } | 46 | } |
37 | } | 47 | } |
frontend/controllers/SiteController.php
@@ -113,7 +113,7 @@ | @@ -113,7 +113,7 @@ | ||
113 | if (empty( Yii::$app->request->post() )) { | 113 | if (empty( Yii::$app->request->post() )) { |
114 | throw new BadRequestHttpException(); | 114 | throw new BadRequestHttpException(); |
115 | } else { | 115 | } else { |
116 | - $model = new Order(); | 116 | + $model = new Order(['scenario' => Order::SCENARIO_ORDER]); |
117 | if ($model->load(Yii::$app->request->post()) && $model->save()) { | 117 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
118 | 118 | ||
119 | try { | 119 | try { |