From ef1d9c61e0a700bcf5f2efc7434ab24f579a180c Mon Sep 17 00:00:00 2001 From: Ezhil Shanmugham Date: Sat, 21 Oct 2023 20:42:01 +0530 Subject: [PATCH] Fix: #41005 Resend welcome email Signed-off-by: Ezhil Shanmugham --- apps/provisioning_api/lib/Controller/UsersController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 1920128d2466b..3d0cbd43124c9 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -4,6 +4,7 @@ /** * @copyright Copyright (c) 2016, ownCloud, Inc. + * @copyright Copyright (c) 2023, Ezhil Shanmugham * * @author Arthur Schiwon * @author Bjoern Schiessle @@ -25,6 +26,7 @@ * @author Tom Needham * @author Vincent Petry * @author Kate Döen + * @author Ezhil Shanmugham * * @license AGPL-3.0 * @@ -1546,7 +1548,12 @@ public function resendWelcomeMessage(string $userId): DataResponse { } try { - $emailTemplate = $this->newUserMailHelper->generateTemplate($targetUser, false); + if ($this->config->getUserValue($targetUser->getUID(), 'core', 'lostpassword')) { + $emailTemplate = $this->newUserMailHelper->generateTemplate($targetUser, true); + } else { + $emailTemplate = $this->newUserMailHelper->generateTemplate($targetUser, false); + } + $this->newUserMailHelper->sendMail($targetUser, $emailTemplate); } catch (\Exception $e) { $this->logger->error(