getEmail() public method

public getEmail ( )
コード例 #1
0
 public function sendEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['new'];
     $url = $this->router->generate('fos_user_registration_confirm_email', ['token' => $user->getConfirmationToken(), 'email' => $user->getEmail()], true);
     $context = ['user' => $user, 'confirmationUrl' => $url];
     $this->sendMessage($template, $context, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function updateUser(UserInterface $user, $andFlush = true)
 {
     // Extract email part before the `@` character to use it as username is username not set
     if (null === $user->getUsername()) {
         $user->setUsername(substr($user->getEmail(), 0, strpos($user->getEmail(), '@')));
     }
     // Call parent after as does not override parent and parent do the flush
     parent::updateUser($user, $andFlush);
 }
コード例 #3
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->getTemplate('resetting');
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'confirmationUrl' => $url);
     return $this->sendMessage($template, $context, $this->getFromEmail('resetting'), $user->getEmail());
 }
コード例 #4
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), UrlGeneratorInterface::ABSOLUTE_URL);
     $context = array('user' => $user, 'confirmationUrl' => $url);
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #5
0
ファイル: UserEventListener.php プロジェクト: ulakjira/ojs
 /**
  * @param UserInterface $user
  * @param string $subject
  * @param string $body
  */
 private function sendMail(UserInterface $user, $subject, $body)
 {
     $message = $this->mailer->createMessage();
     $to = array($user->getEmail() => $user->getUsername());
     $message = $message->setSubject($subject)->addFrom($this->mailSender, $this->mailSenderName)->setTo($to)->setBody($body, 'text/html');
     $this->mailer->send($message);
 }
コード例 #6
0
ファイル: Mailer.php プロジェクト: tkuska/user
 /**
  * {@inheritdoc}
  */
 public function sendCreationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['creation.template'];
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), UrlGeneratorInterface::ABSOLUTE_URL);
     $rendered = $this->templating->render($template, array('user' => $user, 'password' => $user->getPlainPassword(), 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['creation'], $user->getEmail());
 }
コード例 #7
0
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('get_reset_resetting', array('token' => $user->getConfirmationToken()), true);
     $context = array('user' => $user, 'confirmationUrl' => str_replace('api', '#', $url));
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #8
0
ファイル: Mailer.php プロジェクト: dasklney/kreta
 /**
  * {@inheritdoc}
  */
 public function sendInvitationEmail(UserInterface $user)
 {
     $template = $this->parameters['invitation.template'];
     $url = $this->router->generate('kreta_user_registration', ['token' => $user->getConfirmationToken()], true);
     $rendered = $this->templating->render($template, ['user' => $user, 'registerUrl' => $url]);
     $this->sendEmailMessage($rendered, self::KRETA_INVITATION_EMAIL, $user->getEmail());
 }
コード例 #9
0
ファイル: Mailer.php プロジェクト: KnpLabs/KnpUserBundle
 public function sendResettingEmailMessage(UserInterface $user, $engine)
 {
     $template = $this->parameters['resetting_password.template'];
     $url = $this->router->generate('fos_user_user_reset_password', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template . '.txt.' . $engine, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->getSenderEmail('resetting_password'), $user->getEmail());
 }
コード例 #10
0
ファイル: Mailer.php プロジェクト: rommsen/plesynd
 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['confirmation.template'];
     $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => str_replace('%23', '#', $url)));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
コード例 #11
0
ファイル: Mailer.php プロジェクト: jjspider277/weddings
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['resetting.template'];
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #12
0
 /**
  * @param UserInterface $user
  * @return UserDTO
  */
 public static function withEntity(UserInterface $user)
 {
     $dto = new UserDTO();
     $dto->setId($user->getId());
     $dto->setEmail($user->getEmail());
     $dto->setApiKey($user->getApiKey());
     return $dto;
 }
コード例 #13
0
ファイル: Mailer.php プロジェクト: viettut/todo
 /**
  * Override for change resetting url
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['resetting.template'];
     $resetLink = $this->parameters['password_resetting_link'];
     $url = $resetLink . '/' . $user->getConfirmationToken();
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #14
0
 /**
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $url = $this->router->generate('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $subject = $this->translate('resetting.email.subject', $user->getUsername(), $url);
     $body = $this->translate('resetting.email.message', $user->getUsername(), $url);
     $rendered = $this->templating->render('@App/Utils/email_structure.html.twig', array('body' => $body));
     $this->sendEmailMessage($rendered, $subject, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #15
0
 /**
  * Get the truncated email displayed when requesting the resetting.
  *
  * The default implementation only keeps the part following @ in the address.
  *
  * @param \FOS\UserBundle\Model\UserInterface $user
  *
  * @return string
  */
 protected function getObfuscatedEmail(UserInterface $user)
 {
     $email = $user->getEmail();
     if (false !== ($pos = strpos($email, '@'))) {
         $email = '...' . substr($email, $pos);
     }
     return $email;
 }
コード例 #16
0
ファイル: Mailer.php プロジェクト: bruery/platform
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['template']['resetting'];
     $url = $this->router->generate('sonata_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);
     $email = key($this->parameters['from_email']['resetting']);
     $context = array('user' => $user, 'confirmationUrl' => $url, 'ttl' => $this->parameters['ttl'], 'email' => $email, 'administrator' => $this->parameters['from_email']['resetting'][$email], 'request' => $this->requestStack->getCurrentRequest());
     $this->sendMessage($template, $context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #17
0
ファイル: Mailer.php プロジェクト: sujit13666/SymfonyReal2
 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     //        var_dump($user->getConfirmationToken());
     //        die();
     $template = $this->parameters['confirmation.template'];
     //        $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()), true);
     $url = "http://localhost:8080/SymfonyClient/app/#/core/signup/confirm/?code=" . $user->getConfirmationToken();
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
コード例 #18
0
 /**
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $from = $this->fromEmail;
     $template = 'Emails/password_reseting_email.html.twig';
     $url = $this->router->generate('rentme', array(), true) . "/" . $user->getConfirmationToken();
     //$url = path('rentme') . "?passwordResetButton&token=" + $user->getConfirmationToken();
     $url .= "?passwordReset";
     $to = $user->getEmail();
     $rendered = $this->templating->render($template, array('user' => $user, 'resetUrl' => $url, 'mailer_app_url_prefix' => $this->parameters['mailer_app_url_prefix']));
     $this->sendEmailMessage($rendered, $from, $to, "hey! VIENNA password reset.");
 }
コード例 #19
0
ファイル: Mailer.php プロジェクト: lenybernard/icaque-api
 public function sendConfirmationEmailMessage(UserInterface $user)
 {
     $template = $this->parameters['confirmation.template'];
     $request = $this->requestStack->getMasterRequest();
     $callback = $request->request->get('callback');
     //TODO check si callback existe
     $pattern = $request->request->get('pattern') ?: ':token';
     $token = $user->getConfirmationToken();
     $url = preg_replace("/{$pattern}/", $token, $callback);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['confirmation'], $user->getEmail());
 }
コード例 #20
0
ファイル: UserMailer.php プロジェクト: enhavo/enhavo
 public function sendResettingEmailMessage(UserInterface $user, $template = null, $route = null)
 {
     if ($template === null) {
         $template = $this->parameters['resetting.template'];
     }
     if ($route === null) {
         $route = 'enhavo_user_user_reset_password_confirm';
     }
     $url = $this->router->generate($route, array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #21
0
ファイル: FOLMailer.php プロジェクト: sfriel/fol
 /**
  * {@inheritdoc}
  */
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $isAdmin = '/foladmin/resetting/send/email' === $this->router->getContext()->getPathInfo();
     $to_route = 'fos_user_resetting_reset';
     if ($isAdmin) {
         $to_route = 'admin_resetting_reset';
     }
     $template = $this->parameters['resetting.template'];
     $url = $this->router->generate($to_route, array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->templating->render($template, array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #22
0
ファイル: UserMailer.php プロジェクト: Sup3rgnu/Kompisbyran
 /**
  * @param UserInterface $user
  */
 public function sendRegistrationWelcomeEmailMessage(UserInterface $user)
 {
     $subject = 'user.welcome.message.subject';
     $htmlBody = 'user.welcome.message.body';
     $txtBody = 'user.welcome.message.body.txt';
     if ($user->isMusicFriend()) {
         $subject = 'user.friend.welcome.message.subject';
         $htmlBody = 'user.friend.welcome.message.body';
         $txtBody = 'user.friend.welcome.message.body.txt';
     }
     $subject = $this->translator->trans($subject);
     $htmlBody = $this->translator->trans($htmlBody);
     $txtBody = $this->translator->trans($txtBody);
     $html = $this->templating->render('email/welcome.html.twig', ['body' => $htmlBody]);
     $txt = $this->templating->render('email/welcome.txt.twig', ['body' => $txtBody]);
     $this->sendEmailMessage($html, $txt, $subject, $user->getEmail());
 }
コード例 #23
0
ファイル: UserRepository.php プロジェクト: a2c/bacon-manager
 public function getQueryPagination(UserInterface $entity, $sort, $direction)
 {
     $queryBuilder = $this->createQueryBuilder('u');
     $data = ['id' => $entity->getId(), 'username' => $entity->getUsername(), 'email' => $entity->getEmail(), 'enabled' => $entity->isEnabled()];
     if (!empty($data['id'])) {
         $queryBuilder->andWhere($queryBuilder->expr()->eq('u.id', ':id'))->setParameter('id', $data['id']);
     }
     if (!empty($data['username'])) {
         $queryBuilder->andWhere($queryBuilder->expr()->like('u.username', ':username'))->setParameter('username', "%{$data['username']}%");
     }
     if (!empty($data['email'])) {
         $queryBuilder->andWhere($queryBuilder->expr()->like('u.email', ':email'))->setParameter('email', "%{$data['email']}%");
     }
     if (!empty($data['enabled'])) {
         $queryBuilder->andWhere($queryBuilder->expr()->eq('u.enabled', ':enabled'))->setParameter('enabled', $data['enabled']);
     }
     $queryBuilder->orderBy('u.' . $sort, $direction);
     return $queryBuilder->getQuery();
 }
コード例 #24
0
ファイル: Mailer.php プロジェクト: Eraac/365raiponce
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $context = array('user' => $user, 'token' => $user->getConfirmationToken());
     $this->sendMessage($context, $this->parameters['from_email']['resetting'], $user->getEmail());
 }
コード例 #25
0
 /**
  * {@inheritdoc}
  */
 public function updateCanonicalFields(UserInterface $user)
 {
     $user->setUsernameCanonical(strtolower($user->getUsername()));
     $user->setEmailCanonical(strtolower($user->getEmail()));
 }
コード例 #26
0
ファイル: OjsMailer.php プロジェクト: beyzakokcan/ojs
 /**
  * @param UserInterface $user
  * @param string $subject
  * @param string $body
  */
 public function sendToUser(UserInterface $user, $subject, $body)
 {
     $this->send($subject, $body, $user->getEmail(), $user->getUsername());
 }
コード例 #27
0
ファイル: UserManager.php プロジェクト: artz20/Tv-shows-zone
 /**
  * {@inheritDoc}
  */
 public function updateCanonicalFields(UserInterface $user)
 {
     $user->setUsernameCanonical($this->canonicalizeUsername($user->getUsername()));
     $user->setEmailCanonical($this->canonicalizeEmail($user->getEmail()));
 }
コード例 #28
0
ファイル: Mailer.php プロジェクト: Eraac/rest-project
 public function sendResettingEmailMessage(UserInterface $user)
 {
     $template = "UserBundle:Resetting:email.txt.twig";
     $context = ['user' => $user, 'token' => $user->getConfirmationToken()];
     $this->sendMessage($template, $context, $user->getEmail());
 }
コード例 #29
0
ファイル: Mailer.php プロジェクト: aBMania/mathsup
 public function sendRegistrationMail(UserInterface $user)
 {
     $url = $this->router->generate('mathsup_register_confirmation', array('token' => $user->getConfirmationToken()), true);
     $rendered = $this->getTemplating()->render($this->parameters['email_template'], array('user' => $user, 'confirmationUrl' => $url));
     $this->sendEmailMessage($rendered, $this->parameters['from_email'], $user->getEmail());
 }
コード例 #30
0
 /**
  * @param UserInterface $user
  * @return UploadedFile
  */
 public function getUserFile(UserInterface $user)
 {
     return $this->getFile($user->getEmail());
 }