Browse Source

Merge tag 'hotfix_1417' into develop

hotfix_1417
feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
bdcc01aa4e
2 changed files with 14 additions and 1 deletions
  1. +13
    -0
      common/forms/ContactForm.php
  2. +1
    -1
      frontend/controllers/SiteController.php

+ 13
- 0
common/forms/ContactForm.php View File

); );
} }


public function sendEmailAdmin()
{
return Yii::$app->mailerService->sendAdmin(
'Contact : ' . $this->subject,
'contact',
[
'content' => $this->body,
'name' => $this->name
],
$this->email
);
}

} }

+ 1
- 1
frontend/controllers/SiteController.php View File

$model = new ContactForm(); $model = new ContactForm();
$messageSent = false; $messageSent = false;
if ($model->load(Yii::$app->request->post()) && $model->validate()) { if ($model->load(Yii::$app->request->post()) && $model->validate()) {
$model->sendEmail(Yii::$app->parameterBag->get('adminEmail'));
$model->sendEmailAdmin();
$messageSent = true; $messageSent = true;
} }



Loading…
Cancel
Save