From d546f4fafc1a04d8d5e4c2f28bd099967e66e355 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 2 Jul 2019 08:04:56 +0200 Subject: [PATCH] Do not fail hard on new user mail error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/provisioning_api/lib/Controller/UsersController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 30094470a7a..e1160568c06 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -306,12 +306,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); } } -- 2.39.5