Files
pathfinder/app/main/lib/logging/formatter/MailFormatter.php
Exodus4D a8edf39697 - new "logging" system for map/system/signature/connection changes, closed #271
- new map change log to Slack channel
- new "rally point" logging to Slack channel
- new "rally point" poke options (e.g. custom message), closed #295
- new log options for WebSocket installations
- added ship "mass" logging (backend only), #313
- added map logging to Slack, #326
- added "ESI error rate" limit detection
- added "Monolog" as new logging library (Composer dependency)
- added "Swiftmailer" as new eMail library (Composer dependency)
- added Support for Redis session hander (performance boost)
- improved character select panels (visible "online" status)
- improved "activity logging" (more DB columns added to check)
- improved eMail logging (HTML template support)
- improved "delete map" now become "inactive" for some days before delete
- improved character logout handling
- improved /setup page for DB bootstrap (new button for DB create if not exists)
- fixed broken ship tracking (ship name re-added)
- fixed broken ship tracking for multiple chars on different browser tabs
- fixed broken cursor coordinates, closed #518
- fixed null pointer "charactermodel.php->isActive():925" closed #529
- fixed broken "scroll offset", closed #533 closed #534
- Updated "validation" library JS v0.10.1 -> v0.11.9
- Updated ORM Mapper _Cortex_ v1.5.0-dev -> v1.5.0
- and many more....
2017-10-22 17:58:34 +02:00

46 lines
1.3 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: exodu
* Date: 07.10.2017
* Time: 14:49
*/
namespace Lib\Logging\Formatter;
use lib\Config;
use Monolog\Formatter;
class MailFormatter implements Formatter\FormatterInterface {
public function format(array $record){
$tplDefaultData = [
'tplPretext' => $record['message'],
'tplGreeting' => \Markdown::instance()->convert(str_replace('*', '', $record['message'])),
'message' => false,
'tplText2' => false,
'tplClosing' => 'Fly save!',
'actionPrimary' => false,
'appName' => Config::getPathfinderData('name'),
'appUrl' => Config::getEnvironmentData('URL'),
'appHost' => $_SERVER['HTTP_HOST'],
'appContact' => Config::getPathfinderData('contact'),
'appMail' => Config::getPathfinderData('email'),
];
$tplData = array_replace_recursive($tplDefaultData, (array)$record['context']['data']['main']);
return \Template::instance()->render('templates/mail/basic_inline.html', 'text/html', $tplData);
}
public function formatBatch(array $records){
$message = '';
foreach ($records as $key => $record) {
$message .= $this->format($record);
}
return $message;
}
}