Skip to content

Commit

Permalink
Fix: #41005 Resend welcome email
Browse files Browse the repository at this point in the history
Signed-off-by: Ezhil Shanmugham <ezhil930@gmail.com>
  • Loading branch information
ezhil56x authored and skjnldsv committed Feb 23, 2024
1 parent 7cf3172 commit ef1d9c6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/provisioning_api/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2023, Ezhil Shanmugham <ezhil930@gmail.com>
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Bjoern Schiessle <bjoern@schiessle.org>
Expand All @@ -25,6 +26,7 @@
* @author Tom Needham <tom@owncloud.com>
* @author Vincent Petry <vincent@nextcloud.com>
* @author Kate Döen <kate.doeen@nextcloud.com>
* @author Ezhil Shanmugham <ezhil930@gmail.com>
*
* @license AGPL-3.0
*
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit ef1d9c6

Please sign in to comment.