Do not try to use empty values

This commit is contained in:
Joas Schilling 2015-02-25 15:50:06 +01:00
Родитель e13acc6b76
Коммит d4e3c9c02a
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -118,15 +118,15 @@ class EmailNotification extends \OC\BackgroundJob\TimedJob {
// Send Email
$default_lang = $this->config->getSystemValue('default_language', 'en');
foreach ($mailData as $user => $data) {
if (!isset($userEmails[$user])) {
if (empty($userEmails[$user])) {
// The user did not setup an email address
// So we will not send an email :(
$this->logger->debug("Couldn't send notification email to user '" . $user . "' (email address isn't set for that user)", ['app' => 'activity']);
continue;
}
$language = (isset($userLanguages[$user])) ? $userLanguages[$user] : $default_lang;
$timezone = (isset($userTimezones[$user])) ? $userTimezones[$user] : 'UTC';
$language = (!empty($userLanguages[$user])) ? $userLanguages[$user] : $default_lang;
$timezone = (!empty($userTimezones[$user])) ? $userTimezones[$user] : 'UTC';
$this->mqHandler->sendEmailToUser($user, $userEmails[$user], $language, $timezone, $data);
}