Skip to content

Commit

Permalink
fix(mail): Fix mail handling when force_language is true or false
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen authored and backportbot-nextcloud[bot] committed Dec 8, 2023
1 parent e55adc6 commit 4d8a0bb
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 4d8a0bb

Please sign in to comment.