public function send(User $User, $subject, $htmlBody) { $message = \Swift_Message::newInstance()->setSubject($subject)->setFrom($this->formEmail, $this->formName)->setTo($User->getEmail(), $User->getUsername())->setBody($htmlBody, 'text/html'); $this->swiftMailer->send($message); }
/** * {@inheritDoc} */ public function postSave() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'postSave', array()); return parent::postSave(); }
public function changePassword(User $User) { if (null == $User->getPlainPassword()) { throw new UserException('Nie ustawiono nowego hasła'); } $encoder = $this->encoderFactory->getEncoder($User); $encoderPassword = $encoder->encodePassword($User->getPlainPassword(), $User->getSalt()); $User->setPassword($encoderPassword); $em = $this->doctrine->getManager(); $em->persist($User); $em->flush(); return true; }