Фикс получателя для формы обратной связи

This commit is contained in:
ErickSkrauch 2016-10-07 17:45:06 +03:00
parent 862c2d467e
commit ad058664db

View File

@ -35,8 +35,8 @@ class FeedbackForm extends ApiForm {
/** @var \yii\swiftmailer\Mailer $mailer */ /** @var \yii\swiftmailer\Mailer $mailer */
$mailer = Yii::$app->mailer; $mailer = Yii::$app->mailer;
$fromEmail = Yii::$app->params['supportEmail']; $supportEmail = Yii::$app->params['supportEmail'];
if (!$fromEmail) { if (!$supportEmail) {
throw new InvalidConfigException('Please specify supportEmail value in app params'); throw new InvalidConfigException('Please specify supportEmail value in app params');
} }
@ -47,7 +47,7 @@ class FeedbackForm extends ApiForm {
'account' => $account, 'account' => $account,
]); ]);
$message $message
->setTo($this->email) ->setTo($supportEmail)
->setFrom([$this->email => $account ? $account->username : $this->email]) ->setFrom([$this->email => $account ? $account->username : $this->email])
->setSubject($this->subject); ->setSubject($this->subject);