Skip to content

Commit

Permalink
Merge pull request #1744 from nextcloud/backport/1743/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(mail): Fix mail handling when force_language is true or false
  • Loading branch information
nickvergessen authored Dec 15, 2023
2 parents 4ef5c28 + 42f22ab commit 78bdfe1
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 78bdfe1

Please sign in to comment.