0
<div class="site-contact">
<h1><?= Html::encode($this->title) ?></h1>
<?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>
<div class="alert alert-success">
Obrigado por fazer a solicitação no Peça Agora. Responderemos o mais rápido possível!
</div>
<?php else: ?>
<p>
Caso não tenha encontrado a peça desejada em nosso site, faça sua solicitação de orçamento aqui.
</p>
<div class="row">
<div class="col-lg-5">
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
<?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?>
<?= $form->field($model, 'email') ?>
<?= $form->field($model, 'subject')->hint('Ex: Punto 2009 ELX 1.4') ?>
<?= $form->field($model, 'body')->textArea(['rows' => 12, 'value' => $texto]) ?>
<div class="form-group">
<?= Html::submitButton('Enviar Solicitação',
['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
<?php endif; ?>
CONTROLLER
class OrcamentoController extends \yii\web\Controller
{
public function actionIndex()
{
$model = new Orcamento();
if ($model->load(Yii::$app->request->post()) && $model->contact('[email protected]')) {
Yii::$app->session->setFlash('contactFormSubmitted');
return $this->refresh();
}
return $this->render('index', [
'model' => $model,
]);
}
}
?>
When trying to answer the form email, there is the email of the destination that filled, is my email that is in the controller
You set the header
Reply-To
when sending the email?– Woss
No, and how can I do that! Thank you
– Paulo Junior
Could someone help me?
– Paulo Junior