i am following this tutorial:
http://tutorial.symblog.co.uk/docs/validators-and-forms.html
at the swift mailer part i am not getting the envelope icon in the developer bar. i am following the tutorial on my dev box so it wont send the actual email therefore i must get the envelope?
here my app/config/parameters.ini:
mailer_transport = "gmail"
mailer_encryption = "ssl"
mailer_auth_mode = "login"
mailer_host = "smtp.gmail.com"
mailer_user = "myemail@host.net"
mailer_password = "mypassword"
then i have src/Blogger/BlogBundle/Controller/PageController.php:
public function contactAction()
{
#return $this->render('BloggerBlogBundle:Page:contact.html.twig');
$enquiry = new Enquiry();
$form = $this->createForm(new EnquiryType(), $enquiry);
$request = $this->getRequest();
if ($request->getMethod() == 'POST')
{
$form->bindRequest($request);
if ($form->isValid())
{
// Perform some action, such as sending an email
$message = \Swift_Message::newInstance()
->setSubject('Contact enquiry from symblog')
->setFrom('enquiries@symblog.co.uk')
->setTo($this->container->getParameter('blogger_blog.emails.contact_email'))
->setBody($this->renderView('BloggerBlogBundle:Page:contactEmail.txt.twig', array('enquiry' => $enquiry)));
$this->get('mailer')->send($message);
$this->get('session')->setFlash('blogger-notice', 'Your contact enquiry was successfully sent. Thank you!');
// Redirect - This is important to prevent users re-posting
// the form if they refresh the page
return $this->redirect($this->generateUrl('BloggerBlogBundle_contact'));
}
}
return $this->render('BloggerBlogBundle:Page:contact.html.twig', array(
'form' => $form->createView()
));
after this i have everything like they have it,what am i missing?
please help?
thanks
You don’t see the email icon because there is no email sent in the current request.
Actually, you’re redirecting the user after sending the email so the request you see in the debug toolbar is the one after the one in which you send the email.
If you want to see the sent email, you have to go in the profiler history: