<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Util\EMailer;
use Exception;
+use Friendica\App;
use Friendica\App\BaseURL;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
$this->config = $config;
$this->logger = $logger;
- $hostname = $baseUrl->getHostname();
+ $hostname = $baseUrl->getHost();
if (strpos($hostname, ':')) {
$hostname = substr($hostname, 0, strpos($hostname, ':'));
}
$this->headers = [
'Precedence' => ['list'],
'X-Friendica-Host' => [$hostname],
- 'X-Friendica-Platform' => [FRIENDICA_PLATFORM],
- 'X-Friendica-Version' => [FRIENDICA_VERSION],
+ 'X-Friendica-Platform' => [App::PLATFORM],
+ 'X-Friendica-Version' => [App::VERSION],
'List-ID' => ['<notification.' . $hostname . '>'],
- 'List-Archive' => ['<' . $baseUrl->get() . '/notifications/system>'],
+ 'List-Archive' => ['<' . $baseUrl . '/notifications/system>'],
];
}
{
$this->recipientUid = $user['uid'] ?? 0;
try {
- $this->l10n = $user['language'] ? $this->l10n->withLang($user['language']) : $this->l10n;
+ $this->l10n = isset($user['language']) ? $this->l10n->withLang($user['language']) : $this->l10n;
} catch (Exception $e) {
$this->logger->warning('cannot use language.', ['user' => $user, 'exception' => $e]);
}
$tpl = Renderer::getMarkupTemplate('email/html.tpl');
$msgHtml = Renderer::replaceMacros($tpl, [
'$title' => $this->l10n->t('Friendica Notification'),
- '$product' => FRIENDICA_PLATFORM,
+ '$product' => App::PLATFORM,
'$htmlversion' => $msgHtml,
'$sitename' => $this->config->get('config', 'sitename'),
'$banner' => $this->config->get('system', 'email_banner',
- $this->baseUrl->get(true) . DIRECTORY_SEPARATOR . self::DEFAULT_EMAIL_BANNER),
+ $this->baseUrl . DIRECTORY_SEPARATOR . self::DEFAULT_EMAIL_BANNER),
]);
}