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
path: root/lib
diff options
context:
space:
mode:
authorDaniel Thwaites <danthwaites30@btinternet.com>2022-03-30 01:26:24 +0300
committerDaniel Thwaites <danthwaites30@btinternet.com>2022-03-30 01:44:05 +0300
commitce4638c1a1b8a33dc6687ce458622a5074ab6c8c (patch)
tree3546f673e05855ca5caa0ea6f4c5c789ee699b0b /lib
parent74b2cbe0611c996f7360ac49bd2396543e9e7f21 (diff)
Fix admin notification when user has no email address
Fixes #406. Signed-off-by: Daniel Thwaites <danthwaites30@btinternet.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/MailService.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Service/MailService.php b/lib/Service/MailService.php
index 2682658..35e0bde 100644
--- a/lib/Service/MailService.php
+++ b/lib/Service/MailService.php
@@ -147,7 +147,7 @@ class MailService {
}
}
- public function notifyAdmins(string $userId, string $userEMailAddress, bool $userIsEnabled, string $userGroupId): void {
+ public function notifyAdmins(string $userId, ?string $userEMailAddress, bool $userIsEnabled, string $userGroupId): void {
// Notify admin
$adminUsers = $this->groupManager->get('admin')->getUsers();
@@ -186,7 +186,7 @@ class MailService {
* @param bool $userIsEnabled the new user account is enabled
* @throws \Exception
*/
- private function sendNewUserNotifyEmail(array $to, string $username, string $userEMailAddress, bool $userIsEnabled): void {
+ private function sendNewUserNotifyEmail(array $to, string $username, ?string $userEMailAddress, bool $userIsEnabled): void {
$link = $this->urlGenerator->linkToRouteAbsolute('settings.Users.usersListByGroup', [
'group' => 'disabled',
]);
@@ -206,7 +206,7 @@ class MailService {
$template->addBodyText(
$this->l10n->t('"%1$s" (%2$s) registered a new account on %3$s.', [
$username,
- $userEMailAddress,
+ $userEMailAddress ?? $this->l10n->t('no email address given'),
$this->defaults->getName(),
])
);
@@ -214,7 +214,7 @@ class MailService {
$template->addBodyText(
$this->l10n->t('"%1$s" (%2$s) registered a new account on %3$s and needs to be enabled.', [
$username,
- $userEMailAddress,
+ $userEMailAddress ?? $this->l10n->t('no email address given'),
$this->defaults->getName(),
])
);