Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/registration.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-01-04 18:57:01 +0300
committerJoas Schilling <coding@schilljs.com>2022-01-04 18:57:01 +0300
commitdaf761a3b0570b9f6ad8a8a8db449fafa6c65ed4 (patch)
tree91029b873ed456e1591d57ec3d8152c7c2c39a5f
parent40dbfc9cbe7cdb9e63e295bd0035955e26e3c628 (diff)
Move config removal to sending part
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/Listener/UserEnabledListener.php1
-rw-r--r--lib/Service/RegistrationService.php2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/Listener/UserEnabledListener.php b/lib/Listener/UserEnabledListener.php
index c7495aa..9ff5b1c 100644
--- a/lib/Listener/UserEnabledListener.php
+++ b/lib/Listener/UserEnabledListener.php
@@ -56,7 +56,6 @@ class UserEnabledListener implements IEventListener {
$user = $event->getUser();
$value = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'send_welcome_mail_on_enable', 'no');
if ($value === 'yes') {
- $this->config->deleteUserValue($user->getUID(), Application::APP_ID, 'send_welcome_mail_on_enable');
$this->registrationService->sendWelcomeMail($event->getUser());
}
}
diff --git a/lib/Service/RegistrationService.php b/lib/Service/RegistrationService.php
index f0a5270..3eefa6d 100644
--- a/lib/Service/RegistrationService.php
+++ b/lib/Service/RegistrationService.php
@@ -440,6 +440,8 @@ class RegistrationService {
}
public function sendWelcomeMail(IUser $user): void {
+ $this->config->deleteUserValue($user->getUID(), Application::APP_ID, 'send_welcome_mail_on_enable');
+
if ($this->config->getAppValue('core', 'newUser.sendEmail', 'yes') === 'yes') {
/** @var NewUserMailHelper $helper */
$helper = \OC::$server->get(NewUserMailHelper::class);