Skip to content

Commit

Permalink
Merge pull request #1743 from nextcloud/bugfix/1742/fix-force-languag…
Browse files Browse the repository at this point in the history
…e-handling

fix(mail): Fix mail handling when force_language is true or false
  • Loading branch information
blizzz authored Dec 8, 2023
2 parents b3508b3 + 30d96e0 commit 30fd428
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 @@ -135,11 +135,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 30fd428

Please sign in to comment.