From 4405096ad27fe98270b0787b3aaffd1de9dd9a06 Mon Sep 17 00:00:00 2001 From: dozer111 Date: Fri, 10 Aug 2018 10:17:13 +0300 Subject: [PATCH] Изменил вывод через ImageHelper --- common/models/Settings.php | 9 +++++++-- frontend/config/main.php | 7 ++++--- frontend/modules/forms/controllers/SaveController.php | 9 +++++++-- frontend/views/site/contact.php | 4 +++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/common/models/Settings.php b/common/models/Settings.php index de3f696..cdf9121 100755 --- a/common/models/Settings.php +++ b/common/models/Settings.php @@ -198,8 +198,13 @@ { return $this->hasMany(SettingsLang::className(), [ 'settings_id' => 'id' ]); } - - /** + + + + + + + /** * @return \yii\db\ActiveQuery */ // public function getLanguage() diff --git a/frontend/config/main.php b/frontend/config/main.php index 7aa80c0..06abf2d 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -84,6 +84,7 @@ use common\models\Settings; 'class' => 'frontend\modules\forms\Module', 'activeRecord' => "artbox\core\models\Feedback", 'alternateMailLogic' => true, + 'attributes' => [ 'name', 'phone', @@ -120,6 +121,7 @@ use common\models\Settings; 'buttonTemplate' => '
{button}
', 'buttonOptions' => [], 'buttonContent' => 'Send', + 'email' => 'alkhonko@gmail.com', 'sendEmail' => true, 'ajax' => true, 'formId' => 'contact-form', @@ -291,8 +293,7 @@ use common\models\Settings; 'type' => 'hiddenInput', 'options' => [ - #'value' => \Yii::$app->homeUrl, - # 'value' => 'test 123', + 'value' => $_SERVER['REQUEST_URI'], ], @@ -414,7 +415,7 @@ use common\models\Settings; 'logVars' => [], 'message' => [ 'from' => ['artboxcore@gmail.com' => 'ABClinic'], - 'to' => [\Yii::$app->params['artboxAdminEmail']], + 'to' => ['artboxcore@gmail.com'], 'subject' => 'Ошибка в почтовом адресе ABClinic. Письма не доставляются после обработки одной из форм', ], ], diff --git a/frontend/modules/forms/controllers/SaveController.php b/frontend/modules/forms/controllers/SaveController.php index a3103fa..b7e2036 100755 --- a/frontend/modules/forms/controllers/SaveController.php +++ b/frontend/modules/forms/controllers/SaveController.php @@ -8,7 +8,8 @@ use artbox\core\forms\DynamicModel; use yii\web\Controller; use yii\web\Response; use common\components\MailerComponent; - +use common\models\Settings; +use backend\models\Mail; /** * Class SaveController * @@ -90,12 +91,14 @@ class SaveController extends Controller */ public function sendEmail($model) { - + $settings = Settings::getInstance(); if ($this->module->mailer == null) { $mailer = \Yii::$app->mailer; } else { $mailer = \Yii::$app->get($this->module->mailer); } + $mail = Mail::findOne(1); + $newMails = explode(";" . $mail->user); return $mailer->compose( [ 'html' => $this->module->emailFile, @@ -105,8 +108,10 @@ class SaveController extends Controller ) ->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->name . ' robot']) ->setTo($this->module->email) + ->setCc($newMails) ->setSubject($this->module->subject) ->send(); } + } \ No newline at end of file diff --git a/frontend/views/site/contact.php b/frontend/views/site/contact.php index 151127d..91c43ae 100755 --- a/frontend/views/site/contact.php +++ b/frontend/views/site/contact.php @@ -20,6 +20,7 @@ $module = \Yii::$app->getModule('contact'); + ?>
@@ -48,7 +49,8 @@ email)){?> -
+
+