/** * @param User $user * * @return GalaxyUser */ private function userTransformer(User $user) { $username = $user->getUsername(); $attributes = array(); $attributes['mail'] = $user->getEmail(); $attributes['first'] = $user->getFirstname(); $attributes['last'] = $user->getLastname(); $attributes['nationality'] = $user->getSection()->getCountry(); $attributes['picture'] = $user->getGalaxyPicture(); $attributes['birthdate'] = $user->getBirthdate()->format('d/m/Y'); $attributes['gender'] = $user->getGender(); $attributes['telephone'] = $user->getMobile(); $attributes['address'] = $user->getAddress(); $attributes['section'] = $user->getSection()->getCode(); $attributes['country'] = $user->getSection()->getCountry(); $attributes['sc'] = $user->getSection()->getCode(); $attributes['roles'] = explode(',', $user->getGalaxyRoles()); return new GalaxyUser($username, $attributes); }
/** * {@inheritDoc} */ public function getEmail() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getEmail', []); return parent::getEmail(); }
/** * Send email to user * * @param User $user */ private function sendWelcomeEmail(User $user) { $message = \Swift_Message::newInstance()->setSubject('[ESN France] Faucon d\'or')->setFrom($this->container->getParameter('mailer_from'))->setTo($user->getEmail())->setBody($this->get('templating')->render('FaucondorBundle:Emails:welcome.html.twig', array('user' => $user)), 'text/html'); $this->get('mailer')->send($message); }
/** * @param User $user * * @return UserValueObject */ private function populateUserValueObject(User $user) { return new UserValueObject($user->getId(), $user->getUsername(), $user->getEmail()); }
/** * Send email to user * * @param User $user */ private function sendEmail(User $user) { $attach = __DIR__ . "/../../../HRBundle/Resources/views/Emails/guide.pptx"; $message = \Swift_Message::newInstance()->setSubject('[ESN Lille] Bienvenue dans l\'association')->setFrom($this->container->getParameter('mailer_from'))->setTo($user->getEmail())->setBody($this->templating->render('FaucondorBundle:Emails:rl.html.twig', array('user' => $user)), 'text/html')->attach(\Swift_Attachment::fromPath($attach)); $this->mailer->send($message); }
public function __construct(User $user) { $this->user = $user; $this->is_completed = false; $this->email = $user->getEmail(); }