Merge pull request #3148 from ekoyle/alert_template_transport

Alert template transport
This commit is contained in:
Neil Lathwood
2016-03-17 20:58:43 +00:00
2 changed files with 13 additions and 3 deletions

View File

@@ -121,8 +121,6 @@ function IssueAlert($alert) {
$obj = DescribeAlert($alert);
if (is_array($obj)) {
echo 'Issuing Alert-UID #'.$alert['id'].'/'.$alert['state'].': ';
$msg = FormatAlertTpl($obj);
$obj['msg'] = $msg;
if (!empty($config['alert']['transports'])) {
ExtTransports($obj);
}
@@ -338,6 +336,9 @@ function ExtTransports($obj) {
$opts = array_filter($opts);
}
if (($opts === true || !empty($opts)) && $opts != false && file_exists($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php')) {
$obj['transport'] = $transport;
$msg = FormatAlertTpl($obj);
$obj['msg'] = $msg;
echo $transport.' => ';
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };');
$tmp = $tmp($obj,$opts);