Commit 4405096ad27fe98270b0787b3aaffd1de9dd9a06
1 parent
c385eaa7
Изменил вывод через ImageHelper
Showing
4 changed files
with
21 additions
and
8 deletions
Show diff stats
common/models/Settings.php
@@ -198,8 +198,13 @@ | @@ -198,8 +198,13 @@ | ||
198 | { | 198 | { |
199 | return $this->hasMany(SettingsLang::className(), [ 'settings_id' => 'id' ]); | 199 | return $this->hasMany(SettingsLang::className(), [ 'settings_id' => 'id' ]); |
200 | } | 200 | } |
201 | - | ||
202 | - /** | 201 | + |
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + /** | ||
203 | * @return \yii\db\ActiveQuery | 208 | * @return \yii\db\ActiveQuery |
204 | */ | 209 | */ |
205 | // public function getLanguage() | 210 | // public function getLanguage() |
frontend/config/main.php
@@ -84,6 +84,7 @@ use common\models\Settings; | @@ -84,6 +84,7 @@ use common\models\Settings; | ||
84 | 'class' => 'frontend\modules\forms\Module', | 84 | 'class' => 'frontend\modules\forms\Module', |
85 | 'activeRecord' => "artbox\core\models\Feedback", | 85 | 'activeRecord' => "artbox\core\models\Feedback", |
86 | 'alternateMailLogic' => true, | 86 | 'alternateMailLogic' => true, |
87 | + | ||
87 | 'attributes' => [ | 88 | 'attributes' => [ |
88 | 'name', | 89 | 'name', |
89 | 'phone', | 90 | 'phone', |
@@ -120,6 +121,7 @@ use common\models\Settings; | @@ -120,6 +121,7 @@ use common\models\Settings; | ||
120 | 'buttonTemplate' => '<div class="button-wr submit-close-wr-c-a">{button}</div>', | 121 | 'buttonTemplate' => '<div class="button-wr submit-close-wr-c-a">{button}</div>', |
121 | 'buttonOptions' => [], | 122 | 'buttonOptions' => [], |
122 | 'buttonContent' => 'Send', | 123 | 'buttonContent' => 'Send', |
124 | + 'email' => 'alkhonko@gmail.com', | ||
123 | 'sendEmail' => true, | 125 | 'sendEmail' => true, |
124 | 'ajax' => true, | 126 | 'ajax' => true, |
125 | 'formId' => 'contact-form', | 127 | 'formId' => 'contact-form', |
@@ -291,8 +293,7 @@ use common\models\Settings; | @@ -291,8 +293,7 @@ use common\models\Settings; | ||
291 | 'type' => 'hiddenInput', | 293 | 'type' => 'hiddenInput', |
292 | 'options' => | 294 | 'options' => |
293 | [ | 295 | [ |
294 | - #'value' => \Yii::$app->homeUrl, | ||
295 | - # 'value' => 'test 123', | 296 | + |
296 | 'value' => $_SERVER['REQUEST_URI'], | 297 | 'value' => $_SERVER['REQUEST_URI'], |
297 | ], | 298 | ], |
298 | 299 | ||
@@ -414,7 +415,7 @@ use common\models\Settings; | @@ -414,7 +415,7 @@ use common\models\Settings; | ||
414 | 'logVars' => [], | 415 | 'logVars' => [], |
415 | 'message' => [ | 416 | 'message' => [ |
416 | 'from' => ['artboxcore@gmail.com' => 'ABClinic'], | 417 | 'from' => ['artboxcore@gmail.com' => 'ABClinic'], |
417 | - 'to' => [\Yii::$app->params['artboxAdminEmail']], | 418 | + 'to' => ['artboxcore@gmail.com'], |
418 | 'subject' => 'Ошибка в почтовом адресе ABClinic. Письма не доставляются после обработки одной из форм', | 419 | 'subject' => 'Ошибка в почтовом адресе ABClinic. Письма не доставляются после обработки одной из форм', |
419 | ], | 420 | ], |
420 | ], | 421 | ], |
frontend/modules/forms/controllers/SaveController.php
@@ -8,7 +8,8 @@ use artbox\core\forms\DynamicModel; | @@ -8,7 +8,8 @@ use artbox\core\forms\DynamicModel; | ||
8 | use yii\web\Controller; | 8 | use yii\web\Controller; |
9 | use yii\web\Response; | 9 | use yii\web\Response; |
10 | use common\components\MailerComponent; | 10 | use common\components\MailerComponent; |
11 | - | 11 | +use common\models\Settings; |
12 | +use backend\models\Mail; | ||
12 | /** | 13 | /** |
13 | * Class SaveController | 14 | * Class SaveController |
14 | * | 15 | * |
@@ -90,12 +91,14 @@ class SaveController extends Controller | @@ -90,12 +91,14 @@ class SaveController extends Controller | ||
90 | */ | 91 | */ |
91 | public function sendEmail($model) | 92 | public function sendEmail($model) |
92 | { | 93 | { |
93 | - | 94 | + $settings = Settings::getInstance(); |
94 | if ($this->module->mailer == null) { | 95 | if ($this->module->mailer == null) { |
95 | $mailer = \Yii::$app->mailer; | 96 | $mailer = \Yii::$app->mailer; |
96 | } else { | 97 | } else { |
97 | $mailer = \Yii::$app->get($this->module->mailer); | 98 | $mailer = \Yii::$app->get($this->module->mailer); |
98 | } | 99 | } |
100 | + $mail = Mail::findOne(1); | ||
101 | + $newMails = explode(";" . $mail->user); | ||
99 | return $mailer->compose( | 102 | return $mailer->compose( |
100 | [ | 103 | [ |
101 | 'html' => $this->module->emailFile, | 104 | 'html' => $this->module->emailFile, |
@@ -105,8 +108,10 @@ class SaveController extends Controller | @@ -105,8 +108,10 @@ class SaveController extends Controller | ||
105 | ) | 108 | ) |
106 | ->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->name . ' robot']) | 109 | ->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->name . ' robot']) |
107 | ->setTo($this->module->email) | 110 | ->setTo($this->module->email) |
111 | + ->setCc($newMails) | ||
108 | ->setSubject($this->module->subject) | 112 | ->setSubject($this->module->subject) |
109 | ->send(); | 113 | ->send(); |
110 | } | 114 | } |
111 | 115 | ||
116 | + | ||
112 | } | 117 | } |
113 | \ No newline at end of file | 118 | \ No newline at end of file |
frontend/views/site/contact.php
@@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
20 | 20 | ||
21 | 21 | ||
22 | $module = \Yii::$app->getModule('contact'); | 22 | $module = \Yii::$app->getModule('contact'); |
23 | + | ||
23 | ?> | 24 | ?> |
24 | 25 | ||
25 | <section class="section-contact-page"> | 26 | <section class="section-contact-page"> |
@@ -48,7 +49,8 @@ | @@ -48,7 +49,8 @@ | ||
48 | </div> | 49 | </div> |
49 | <?php }?> | 50 | <?php }?> |
50 | <?php if (!empty($settings->email)){?> | 51 | <?php if (!empty($settings->email)){?> |
51 | - <div class="ico-map ico-map-mail"><img src="/images/map/mail-map-1-grey.svg" alt=""></div> | 52 | + <div class="ico-map ico-map-mail"> |
53 | + <img src="/images/map/mail-map-1-grey.svg" alt=""></div> | ||
52 | <div class="map-mail"> | 54 | <div class="map-mail"> |
53 | <a href="mailto:<?=$settings->email?>"> | 55 | <a href="mailto:<?=$settings->email?>"> |
54 | <?=$settings->email?> | 56 | <?=$settings->email?> |