Ver código fonte

Merge branch 'hotfix/hotfix_1417'

master
Guillaume Bourgeois 1 ano atrás
pai
commit
1a0c23fbd1
2 arquivos alterados com 14 adições e 1 exclusões
  1. +13
    -0
      common/forms/ContactForm.php
  2. +1
    -1
      frontend/controllers/SiteController.php

+ 13
- 0
common/forms/ContactForm.php Ver arquivo

); );
} }


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 Ver arquivo

$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;
} }



Carregando…
Cancelar
Salvar