aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-07-02 08:04:56 +0200
committerBackportbot <backportbot-noreply@rullzer.com>2019-07-02 09:55:22 +0000
commitd546f4fafc1a04d8d5e4c2f28bd099967e66e355 (patch)
tree952310bc537f60b0b1c1dc51049c2d736b6dc5d5
parentd851e4daa1d609fce21a02393dca8770e20e9467 (diff)
downloadnextcloud-server-d546f4fafc1a04d8d5e4c2f28bd099967e66e355.tar.gz
nextcloud-server-d546f4fafc1a04d8d5e4c2f28bd099967e66e355.zip
Do not fail hard on new user mail error
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php5
1 files 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);
}
}