public function processa() { if (!$this->validacao->getMensagemErro()) { $this->manEmail->setRementente("Site @ Mep Group")->setAssunto("Contato via Site")->setNome(Post::NOME())->setEmail(Post::EMAIL())->setMensagem(\utf8_decode("Ola, preenchi o seu formulário de Servicos e me interessei pelos seguintes:<br>" . Post::SERVICOS_ESCOLHIDOS() . "<hr>Segue uma breve descrição do que quero fazer:<br>" . Post::MENSAGEM() . "<hr>" . "Se possível, no seguinte prazo:" . Post::PRAZO_ESCOLHIDO() . "<hr>Informo também os seguintes contatos:<br>\r\n Telefone:" . Post::TELEFONE() . "- Celular" . Post::CELULAR() . "- Estado:" . Post::UF())); $this->manEmail->prepara()->processa(); return function ($destinatario, $nome) { return $this->manEmail->addDestinatario($destinatario, $nome)->enviaEmail(); }; } throw new \Exception($this->printErro()); }
public function processa() { if (!$this->validacao->getMensagemErro()) { $this->manEmail->setRementente("Site @ Mep Group")->setAssunto(\Mep\Handlers\FiltroPost::ASSUNTO())->setNome(\Mep\Handlers\FiltroPost::NOME())->setEmail(\Mep\Handlers\FiltroPost::EMAIL())->setMensagem(\Mep\Handlers\FiltroPost::MENSAGEM() . "<br> Tel:" . \Mep\Handlers\FiltroPost::TELEFONE()); $this->manEmail->prepara()->processa(); return function ($destinatario, $nome) { return $this->manEmail->addDestinatario($destinatario, $nome)->enviaEmail(); }; } throw new \Exception($this->printErro()); }
public function processa() { if (!$this->printErro()) { $this->manEmail->setRementente("Site @ Mep Group")->setAssunto("Contato via Fale conosco")->setNome(\Mep\Handlers\FiltroPost::USERNAME())->setEmail(\Mep\Handlers\FiltroPost::EMAIL())->setMensagem(\Mep\Handlers\FiltroPost::MENSAGEM()); $this->manEmail->prepara()->processa(); try { $this->manEmail->addDestinatario("*****@*****.**", "Marcos Ammon")->enviaEmail(); echo "Formulário Processado"; } catch (\Exception $ex) { $this->printErro($ex->getMessage()); } } return; }
<div> Username:<input type="text" name="username" value="<?php echo Post::USERNAME(); ?> "> </div> <div> Email:<input type="text" name="email" value="<?php echo Post::EMAIL(); ?> "> </div> <div> Mensagem:<br> <textarea name="mensagem"><?php echo Post::MENSAGEM(); ?> </textarea> </div> <div> <input type="submit"> </div> </form> </body> </html> <?php if ($_SERVER["REQUEST_METHOD"] === "POST") { try { Mep\Container::getFormContato(['username', 'email', 'mensagem'])->prepara()->processa(); } catch (Exception $ex) { die($ex->getMessage());
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Update, Insert and Delete</title> </head> <body> <form action="" method="post"> <div> Matricula:<input type="text" name="matricula" value="<?php echo Post::MATRICULA(); ?> "> </div> <div> Nome:<input type="text" name="nome" value="<?php echo Post::NOME(); ?> "> </div> <div> <?php echo \Mep\Container::getLayout()->renderSecurityField(); ?> <input type="submit"> </div> </form> </body> </html>
<?php header('Content-Type: application/json'); require_once 'Mep/init.php'; use Mep\Container as Mep, Mep\Handlers\FiltroPost as Post; if (Mep::getToken()->checa(Post::TOKEN_SERVICOS())) { $token = Mep::getLayout()->renderSecurityField(); try { $mail = Mep::getFormServicos(['servicos_escolhidos', 'nome', 'telefone', 'celular', 'uf', 'email', 'mensagem'])->prepara()->processa(); $mail("*****@*****.**", "Marcos Ammon"); $status = "Email enviado com sucesso"; } catch (Exception $ex) { $status = $ex->getMessage(); } echo \json_encode(["status" => $status, "novoToken" => $token]); } else { Mep::getLayout()->renderNotFound(); die; }
<?php header('Content-type:text/html;charset=utf-8'); require_once 'Mep/init.php'; use Mep\Container as Mep, Mep\Handlers\FiltroPost as Post; try { $pagina = Post::PAGINA(); Mep::getLayout()->renderContents("servicos/{$pagina}"); } catch (Exception $ex) { Mep::getLayout()->renderNotFound(); die; }
<?php header('Content-Type: application/json'); require_once 'Mep/init.php'; use Mep\Container as Mep, Mep\Handlers\FiltroPost as Post; if (Mep::getToken()->checa(Post::TOKEN())) { $token = Mep::getLayout()->renderSecurityField(); try { $mail = Mep::getFormContato(['nome', 'telefone', 'email', 'assunto', 'mensagem'])->prepara()->processa(); $mail("*****@*****.**", "Marcos Ammon"); $status = "Email enviado com sucesso"; } catch (Exception $ex) { $status = $ex->getMessage(); } echo \json_encode(["status" => $status, "novoToken" => $token]); } else { Mep::getLayout()->renderNotFound(); die; }