Commit 41f1f1488d1de4e6c10a9d598974ba0dd7c041fc
1 parent
cbbc8401
-Emails ready
Showing
2 changed files
with
19 additions
and
4 deletions
Show diff stats
common/models/Customer.php
frontend/controllers/SiteController.php
... | ... | @@ -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 | 193 | return $this->redirect([ 'site/index' ]); |
184 | 194 | } |
... | ... | @@ -207,7 +217,12 @@ |
207 | 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 | 226 | ->setSubject('U have request!') |
212 | 227 | ->attach(\Yii::getAlias('@' . trim($model->image, '/'))) |
213 | 228 | ->send(); | ... | ... |