/**
  *
  * @param User $to
  * @param User $registeredUser
  *
  * @return boolean
  */
 public function mail(User $to, User $registeredUser)
 {
     $body = '';
     $body .= sprintf("Login : %s\n", $registeredUser->getLogin());
     $body .= sprintf("%s : %s\n", _('admin::compte-utilisateur nom'), $registeredUser->getFirstName());
     $body .= sprintf("%s : %s\n", _('admin::compte-utilisateur prenom'), $registeredUser->getLastName());
     $body .= sprintf("%s : %s\n", _('admin::compte-utilisateur email'), $registeredUser->getEmail());
     $body .= sprintf("%s/%s\n", $registeredUser->get_job(), $registeredUser->getCompany());
     $readyToSend = false;
     try {
         $receiver = Receiver::fromUser($to);
         $readyToSend = true;
     } catch (\Exception $e) {
     }
     if ($readyToSend) {
         $mail = MailInfoSomebodyAutoregistered::create($this->app, $receiver, null, $body);
         $this->app['notification.deliverer']->deliver($mail);
     }
     return true;
 }
 public function getMail()
 {
     return MailInfoSomebodyAutoregistered::create($this->getApplication(), $this->getReceiverMock(), $this->getEmitterMock(), $this->getMessage(), $this->getUrl(), $this->getExpiration());
 }