public function indexAction() { $fc = FrontController::getInstance(); $model = new FrontModel(); if ($_SERVER['REQUEST_METHOD'] === 'POST') { Mailer::setData($_POST); if (Mailer::emailHandler()) { Session::setUserMsg('Ваше сообщение успешно отправлено. Мы свяжемся с вами в ближайшее время', 'success'); header('Location: ' . $_SERVER['REQUEST_URI']); exit; } } else { $output = $model->render('../views/contacts/contacts.php', 'withoutSliderAndSidebar'); $fc->setPage($output); } }
private function sendValidateCode() { $siteName = Helper::getSiteConfig()->general->siteName; $siteHost = Helper::getSiteConfig()->general->siteHost; $subject = 'Подтверждение регистрации на сайте ' . $siteName; $content = ' <p>Здравствуйте! Благодарим вас за регистрацию на сайте ' . $siteName . '</p> <p>Для подтверждения регистрации пройдите по ссылке:</p> <a href="' . $siteHost . '/user/validate/email/' . $this->email . '/key/' . $this->validateKey . '">Подтвердить email</a>'; Mailer::emailSender($this->email, $subject, $content); }
public function post(ContactRequest $request) { $this->mailer->send($request); return view('contact.mailsent')->with('name', $request->get('name')); }