public static function getInstance() { if (!isset(self::$_instance)) { self::$_instance = new self(\Mep\Container::getToken()); } return self::$_instance; }
<?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: 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; }