Commit 41f1f1488d1de4e6c10a9d598974ba0dd7c041fc
1 parent
cbbc8401
-Emails ready
Showing
2 changed files
with
19 additions
and
4 deletions
Show diff stats
common/models/Customer.php
| @@ -32,8 +32,8 @@ | @@ -32,8 +32,8 @@ | ||
| 32 | const STATUS_ACTIVE = 1; | 32 | const STATUS_ACTIVE = 1; |
| 33 | const STATUS_NO = 0; | 33 | const STATUS_NO = 0; |
| 34 | 34 | ||
| 35 | - const MALE = 1; | ||
| 36 | - const FEMALE = 2; | 35 | + const MALE = '1'; |
| 36 | + const FEMALE = '2'; | ||
| 37 | /** | 37 | /** |
| 38 | * {@inheritdoc} | 38 | * {@inheritdoc} |
| 39 | */ | 39 | */ |
frontend/controllers/SiteController.php
| @@ -178,7 +178,17 @@ | @@ -178,7 +178,17 @@ | ||
| 178 | ) | 178 | ) |
| 179 | ); | 179 | ); |
| 180 | 180 | ||
| 181 | - $this->mail($model); | 181 | + try { |
| 182 | + $this->mail($model); | ||
| 183 | + } catch (\Exception $exception) { | ||
| 184 | + \Yii::error($exception->getMessage() . '. On request: ' . $model->id); | ||
| 185 | + | ||
| 186 | + return $this->redirect([ 'site/index' ]); | ||
| 187 | + } catch (\Throwable $throwable) { | ||
| 188 | + \Yii::error($throwable->getMessage() . '. On request: ' . $model->id); | ||
| 189 | + | ||
| 190 | + return $this->redirect([ 'site/index' ]); | ||
| 191 | + } | ||
| 182 | 192 | ||
| 183 | return $this->redirect([ 'site/index' ]); | 193 | return $this->redirect([ 'site/index' ]); |
| 184 | } | 194 | } |
| @@ -207,7 +217,12 @@ | @@ -207,7 +217,12 @@ | ||
| 207 | 'artboxcore@gmail.com' => 'Artbox Core', | 217 | 'artboxcore@gmail.com' => 'Artbox Core', |
| 208 | ] | 218 | ] |
| 209 | ) | 219 | ) |
| 210 | - ->setTo('kennen.md@gmail.com') | 220 | + ->setTo( |
| 221 | + [ | ||
| 222 | + 'kennen.md@gmail.com', | ||
| 223 | + 'kazimirova.artweb@gmail.com', | ||
| 224 | + ] | ||
| 225 | + ) | ||
| 211 | ->setSubject('U have request!') | 226 | ->setSubject('U have request!') |
| 212 | ->attach(\Yii::getAlias('@' . trim($model->image, '/'))) | 227 | ->attach(\Yii::getAlias('@' . trim($model->image, '/'))) |
| 213 | ->send(); | 228 | ->send(); |