Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: #41005 Resend welcome email #41038

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
*
* @author Arthur Schiwon <[email protected]>
* @author Bjoern Schiessle <[email protected]>
Expand All @@ -25,6 +26,7 @@
* @author Tom Needham <[email protected]>
* @author Vincent Petry <[email protected]>
* @author Kate Döen <[email protected]>
* @author Ezhil Shanmugham <[email protected]>
*
* @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
Loading