Skip to content

Commit

Permalink
Merge pull request #1746 from nextcloud/backport/1743/stable26
Browse files Browse the repository at this point in the history
[stable26] fix(mail): Fix mail handling when force_language is true or false
  • Loading branch information
nickvergessen authored Dec 15, 2023
2 parents 517a5cc + 4d8a0bb commit 81fd7ef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/MailNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ public function sendEmails(int $batchSize, int $sendTime): void {
$userEnabled = $this->config->getUserValueForUsers('core', 'enabled', $userIds);

$fallbackLang = $this->config->getSystemValue('force_language', null);
if ($fallbackLang === null) {
$fallbackLang = $this->config->getSystemValue('default_language', 'en');
$userLanguages = $this->config->getUserValueForUsers('core', 'lang', $userIds);
} else {
if (is_string($fallbackLang)) {
/** @psalm-var array<string, string> $userLanguages */
$userLanguages = [];
} else {
$fallbackLang = $this->config->getSystemValueString('default_language', 'en');
/** @psalm-var array<string, string> $userLanguages */
$userLanguages = $this->config->getUserValueForUsers('core', 'lang', $userIds);
}

foreach ($userSettings as $settings) {
Expand Down

0 comments on commit 81fd7ef

Please sign in to comment.