Commit bf08679528563816ff586b7e84221ab12dee218b

Authored by alex
1 parent 82a18a27

Mail fix 2

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