use Friendica\Module\Register;
use Friendica\Protocol\PortableContact;
use Friendica\Util\BasePath;
+use Friendica\Util\EMailer\MailBuilder;
use Friendica\Util\Strings;
use Friendica\Worker\Delivery;
$sitename = (!empty($_POST['sitename']) ? Strings::escapeTags(trim($_POST['sitename'])) : '');
$sender_email = (!empty($_POST['sender_email']) ? Strings::escapeTags(trim($_POST['sender_email'])) : '');
$banner = (!empty($_POST['banner']) ? trim($_POST['banner']) : false);
+ $email_banner = (!empty($_POST['email_banner']) ? trim($_POST['email_banner']) : false);
$shortcut_icon = (!empty($_POST['shortcut_icon']) ? Strings::escapeTags(trim($_POST['shortcut_icon'])) : '');
$touch_icon = (!empty($_POST['touch_icon']) ? Strings::escapeTags(trim($_POST['touch_icon'])) : '');
$additional_info = (!empty($_POST['additional_info']) ? trim($_POST['additional_info']) : '');
DI::config()->set('system', 'banner', $banner);
}
+ if (empty($email_banner)) {
+ DI::config()->delete('system', 'email_banner');
+ } else {
+ DI::config()->set('system', 'email_banner', $email_banner);
+ }
+
if (empty($additional_info)) {
DI::config()->delete('config', 'info');
} else {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
+ $email_banner = DI::config()->get('system', 'email_banner');
+
+ if ($email_banner == false) {
+ $email_banner = MailBuilder::DEFAULT_EMAIL_BANNER;
+ }
+
$additional_info = DI::config()->get('config', 'info');
// Automatically create temporary paths
'$sitename' => ['sitename', DI::l10n()->t('Site name'), DI::config()->get('config', 'sitename'), ''],
'$sender_email' => ['sender_email', DI::l10n()->t('Sender Email'), DI::config()->get('config', 'sender_email'), DI::l10n()->t('The email address your server shall use to send notification emails from.'), '', '', 'email'],
'$banner' => ['banner', DI::l10n()->t('Banner/Logo'), $banner, ''],
+ '$email_banner' => ['email_banner', DI::l10n()->t('Email Banner/Logo'), $email_banner, ''],
'$shortcut_icon' => ['shortcut_icon', DI::l10n()->t('Shortcut icon'), DI::config()->get('system', 'shortcut_icon'), DI::l10n()->t('Link to an icon that will be used for browsers.')],
'$touch_icon' => ['touch_icon', DI::l10n()->t('Touch icon'), DI::config()->get('system', 'touch_icon'), DI::l10n()->t('Link to an icon that will be used for tablets and mobiles.')],
'$additional_info' => ['additional_info', DI::l10n()->t('Additional Info'), $additional_info, DI::l10n()->t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())],
*/
abstract class MailBuilder
{
+ /** @var string The default email banner in case nothing else is defined */
+ const DEFAULT_EMAIL_BANNER = 'images/friendica-32.png';
+
/** @var L10n */
protected $l10n;
/** @var IConfig */
// load the template for private message notifications
$tpl = Renderer::getMarkupTemplate('email/html.tpl');
$msgHtml = Renderer::replaceMacros($tpl, [
- '$banner' => $this->l10n->t('Friendica Notification'),
+ '$title' => $this->l10n->t('Friendica Notification'),
'$product' => FRIENDICA_PLATFORM,
'$htmlversion' => $msgHtml,
'$sitename' => $this->config->get('config', 'sitename'),
- '$siteurl' => $this->baseUrl->get(true),
+ '$banner' => $this->config->get('system', 'email_banner',
+ $this->baseUrl->get(true) . DIRECTORY_SEPARATOR . self::DEFAULT_EMAIL_BANNER),
]);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN">
<html>
<head>
- <title>{{$banner}}</title>
+ <title>{{$title}}</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<tbody>
<tr>
<td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;">
- <img style="width:32px;height:32px; float:left;" src='{{$siteurl}}/images/friendica-32.png'>
+ <img style="width:32px;height:32px; float:left;" src='{{$banner}}'>
<div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">{{$product}}</div>
<div style="clear: both;"></div>
</td>