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