Fixed bad message when setting e-mail to empty

This commit is contained in:
Marcin Kurczewski 2014-09-17 11:15:32 +02:00
parent 6a721a0f90
commit aee6ed7dbf

View file

@ -28,12 +28,7 @@ class EmailService
public function sendActivationEmail(\Szurubooru\Entities\User $user, \Szurubooru\Entities\Token $token) public function sendActivationEmail(\Szurubooru\Entities\User $user, \Szurubooru\Entities\Token $token)
{ {
if (!$user->getEmailUnconfirmed()) if (!$user->getEmailUnconfirmed())
{ throw new \BadMethodCallException('An e-mail address is needed to activate the account.');
throw new \BadMethodCallException(
$user->getEmail()
? 'E-mail for this account is already confirmed.'
: 'An e-mail address is needed to activate the account.');
}
$mailSubject = $this->tokenize($this->config->mail->activationSubject); $mailSubject = $this->tokenize($this->config->mail->activationSubject);
$mailBody = $this->tokenizeFile( $mailBody = $this->tokenizeFile(