Commit bf08679528563816ff586b7e84221ab12dee218b

Authored by alex
1 parent 82a18a27

Mail fix 2

common/components/MailerComponent.php
... ... @@ -44,7 +44,7 @@ class MailerComponent extends Component
44 44 ->setTextBody('Контакт пациента: :' . $params['user_data'] . " <br> просил перезвонить ему на протяжении " . $time)
45 45 ->send();
46 46 } catch (\Exception $e) {
47   - \Yii::error($mail->user . " - неполучается отправить письмо за указанным адресом", 'mail_error');
  47 + \Yii::error(\Yii::$app->params['artwebAdminEmail'] . " - неполучается отправить письмо за указанным адресом", 'mail_error');
48 48 }
49 49  
50 50 }
... ...
common/config/params.php
... ... @@ -3,4 +3,5 @@ return [
3 3 'adminEmail' => 'admin@example.com',
4 4 'supportEmail' => 'support@example.com',
5 5 'user.passwordResetTokenExpire' => 3600,
  6 + 'artwebAdminEmail' => 'mailName@test.test',
6 7 ];
... ...
common/models/Settings.php
... ... @@ -186,7 +186,8 @@
186 186 public static function getInstance()
187 187 {
188 188 if (empty( self::$instance )) {
189   - self::$instance = self::find()->with('languages')->where([ 'id' => 1 ])->one();
  189 +
  190 + self::$instance = self::find()->with('languages')->where([ 'id' => 1 ])->one();
190 191 return self::$instance;
191 192 }
192 193  
... ...
frontend/config/main.php
... ... @@ -11,7 +11,7 @@ use common\models\Settings;
11 11 require( __DIR__ . '/params.php' ),
12 12 require( __DIR__ . '/params-local.php' )
13 13 );
14   -
  14 +
15 15 return [
16 16 'id' => 'app-frontend',
17 17 'homeUrl' => '/',
... ... @@ -415,7 +415,7 @@ use common\models\Settings;
415 415 'logVars' => [],
416 416 'message' => [
417 417 'from' => ['alkhonko@gmail.com' => 'ABClinic'],
418   - 'to' => [(Settings::getInstance())->artwebAdminMail],
  418 + 'to' => [\Yii::$app->params['artboxAdminEmail']],
419 419 'subject' => 'Ошибка в почтовом адресе. Письма не доставляются после обработки одной из форм',
420 420 ],
421 421 ],
... ...