Merge pull request #23202 from nextcloud/backport/23182/stable19

[stable19] Fix the user email issue while creating a user
This commit is contained in:
Christoph Wurst 2020-11-10 08:51:35 +01:00 committed by GitHub
commit ceedb95a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -335,8 +335,9 @@ class UsersController extends AUserData {
}
// Send new user mail only if a mail is set
if ($email !== '' && $this->config->getAppValue('core', 'newUser.sendEmail', 'yes') === 'yes') {
if ($email !== '') {
$newUser->setEMailAddress($email);
if ($this->config->getAppValue('core', 'newUser.sendEmail', 'yes') === 'yes') {
try {
$emailTemplate = $this->newUserMailHelper->generateTemplate($newUser, $generatePasswordResetToken);
$this->newUserMailHelper->sendMail($newUser, $emailTemplate);
@ -350,6 +351,7 @@ class UsersController extends AUserData {
]);
}
}
}
return new DataResponse(['id' => $userid]);
} catch (HintException $e) {