From bf08679528563816ff586b7e84221ab12dee218b Mon Sep 17 00:00:00 2001 From: dozer111 Date: Fri, 27 Jul 2018 13:53:41 +0300 Subject: [PATCH] Mail fix 2 --- common/components/MailerComponent.php | 2 +- common/config/params.php | 1 + common/models/Settings.php | 3 ++- frontend/config/main.php | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/components/MailerComponent.php b/common/components/MailerComponent.php index 0e76a50..4b90ad7 100644 --- a/common/components/MailerComponent.php +++ b/common/components/MailerComponent.php @@ -44,7 +44,7 @@ class MailerComponent extends Component ->setTextBody('Контакт пациента: :' . $params['user_data'] . "
просил перезвонить ему на протяжении " . $time) ->send(); } catch (\Exception $e) { - \Yii::error($mail->user . " - неполучается отправить письмо за указанным адресом", 'mail_error'); + \Yii::error(\Yii::$app->params['artwebAdminEmail'] . " - неполучается отправить письмо за указанным адресом", 'mail_error'); } } diff --git a/common/config/params.php b/common/config/params.php index 4ec9ba6..704d998 100644 --- a/common/config/params.php +++ b/common/config/params.php @@ -3,4 +3,5 @@ return [ 'adminEmail' => 'admin@example.com', 'supportEmail' => 'support@example.com', 'user.passwordResetTokenExpire' => 3600, + 'artwebAdminEmail' => 'mailName@test.test', ]; diff --git a/common/models/Settings.php b/common/models/Settings.php index a04a03d..de3f696 100755 --- a/common/models/Settings.php +++ b/common/models/Settings.php @@ -186,7 +186,8 @@ public static function getInstance() { if (empty( self::$instance )) { - self::$instance = self::find()->with('languages')->where([ 'id' => 1 ])->one(); + + self::$instance = self::find()->with('languages')->where([ 'id' => 1 ])->one(); return self::$instance; } diff --git a/frontend/config/main.php b/frontend/config/main.php index 4347f1e..d258bea 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -11,7 +11,7 @@ use common\models\Settings; require( __DIR__ . '/params.php' ), require( __DIR__ . '/params-local.php' ) ); - + return [ 'id' => 'app-frontend', 'homeUrl' => '/', @@ -415,7 +415,7 @@ use common\models\Settings; 'logVars' => [], 'message' => [ 'from' => ['alkhonko@gmail.com' => 'ABClinic'], - 'to' => [(Settings::getInstance())->artwebAdminMail], + 'to' => [\Yii::$app->params['artboxAdminEmail']], 'subject' => 'Ошибка в почтовом адресе. Письма не доставляются после обработки одной из форм', ], ], -- libgit2 0.21.4