Fix the user email issue while creating a user
When the user is created, the provisioning api was not adding the email address of the user when provided if the `send email to new user` is not set. Signed-off-by: Sujith Haridasan <sujith.h@gmail.com>
This commit is contained in:
parent
3759bef671
commit
17705b69aa
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue