public function sendRegistrationMail(user $newUser) { $mail = \Swift_Message::newInstance()->setSubject("Hi " . $newUser->getEmail())->setFrom('*****@*****.**')->setTo($newUser->getEmail())->setBcc('*****@*****.**')->setBody('Hi! Thanks for registering in Easy Project Management app! Hope you will have fun with this management tool. Thanks again!'); $this->get('mailer')->send($mail); }
public function additionAction() { $testUser = new user(); $testUser->setUsername('u'); $testUser->setPassword($this->encodePassword($testUser, 'u')); $manager = $this->getDoctrine()->getEntityManager(); $manager->persist($testUser); $manager->flush(); return $this->render('TicketBundle:Default:index.html.twig', array('text' => 'test user added.')); }
public function load(ObjectManager $manager) { $testUser = new user(); $testUser->setUsername('u'); $testUser->setPassword($this->encodePassword($testUser, 'u')); $manager->persist($testUser); $testAdmin = new user(); $testAdmin->setUsername('a'); $testAdmin->setPassword($this->encodePassword($testUser, 'a')); $testAdmin->setRoles(array('ROLE_ADMIN')); $manager->persist($testAdmin); $manager->flush(); }
public function sendNewTicketMail(user $user, ticket $newTicket) { $mail = \Swift_Message::newInstance()->setSubject("New Ticket in epmanagement appeared!")->setFrom('*****@*****.**')->setTo($user->getEmail(), '*****@*****.**')->setBody($this->renderView('@Mailer/emailTemplateNewTicket.html.twig', array('username' => $user->getUsername(), 'ticket' => $newTicket))); $this->get('mailer')->send($mail); /* ->setBody( $this->renderView( // app/Resources/views/Emails/registration.html.twig 'Emails/registration.html.twig', array('name' => $name) ), 'text/html' ) */ }
public function sendNewTicketMail(user $user, ticket $newTicket) { $mail = \Swift_Message::newInstance()->setSubject("New Ticket in epmanagement appeared!")->setFrom('*****@*****.**')->setTo('*****@*****.**')->setBody($this->renderView('CustomMailerBundle:Mails:emailTemplateNewTicket.html.twig', array('username' => $user->getUsername(), 'ticket' => $newTicket)), 'text/html'); $this->get('mailer')->send($mail); return "mail sent"; }
public function findAllOverdueTicketsUser(user $user) { return $this->createQueryBuilder('t')->andWhere('t.userCreated = :inputUsername')->andWhere('t.dateDeadline <= :now')->setParameter('inputUsername', $user->getId())->setParameter('now', new \DateTime())->getQuery()->execute(); }
/** * {@inheritDoc} */ public function eraseCredentials() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'eraseCredentials', array()); return parent::eraseCredentials(); }
public function findUser(user $user) { return $this->createQueryBuilder('u')->andWhere('u = :inputUserId')->setParameter('inputUserId', $user->getId())->getQuery()->execute(); }