From: John Molakvoæ (skjnldsv) Date: Tue, 2 Jul 2019 06:04:56 +0000 (+0200) Subject: Do not fail hard on new user mail error X-Git-Tag: v17.0.0beta1~222^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F16183%2Fhead;p=nextcloud-server.git Do not fail hard on new user mail error Signed-off-by: John Molakvoæ (skjnldsv) --- diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 93b5d62db36..1fa1f1fa5b3 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -328,12 +328,13 @@ class UsersController extends AUserData { $emailTemplate = $this->newUserMailHelper->generateTemplate($newUser, $generatePasswordResetToken); $this->newUserMailHelper->sendMail($newUser, $emailTemplate); } catch (\Exception $e) { + // Mail could be failing hard or just be plain not configured + // Logging error as it is the hardest of the two $this->logger->logException($e, [ - 'message' => "Can't send new user mail to $email", + 'message' => "Unable to send the invitation mail to $email", 'level' => ILogger::ERROR, 'app' => 'ocs_api', ]); - throw new OCSException('Unable to send the invitation mail', 109); } }