Skip to content

Commit f2d0f04

Browse files
author
Till Brehm
committed
Merge branch 'patch-2' into 'master'
Update monitor_tools.inc.php See merge request ispconfig/ispconfig3!730
2 parents c37625a + bcbbd4f commit f2d0f04

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

server/lib/classes/cron.d/300-quota_notify.inc.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ public function onRunJob() {
8787
//* Send traffic notifications
8888
if($rec['traffic_quota_lock'] != 'y' && ($web_config['overtraffic_notify_admin'] == 'y' || $web_config['overtraffic_notify_client'] == 'y')) {
8989

90-
$placeholders = array('{domain}' => $rec['domain'],
91-
'{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'));
92-
90+
$placeholders = array('{domain}' => $rec['domain'],
91+
'{admin_mail}' => ($global_config['admin_mail'] != ''? $global_config['admin_mail'] : 'root'),
92+
'{used}' => $web_traffic,
93+
'{limit}' => $web_traffic_quota,
94+
'{ratio}' => number_format(($web_traffic_quota > 0 ? $web_traffic/$web_traffic_quota : 0) * 100, 2, '.', '').'%'
95+
);
96+
9397
$recipients = array();
9498
//* send email to admin
9599
if($global_config['admin_mail'] != '' && $web_config['overtraffic_notify_admin'] == 'y') {

server/lib/classes/monitor_tools.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,8 @@ public function send_notification_email($template, $placeholders, $recipients) {
811811
$mailSubject = '';
812812
$inHeader = true;
813813
for($l = 0; $l < count($lines); $l++) {
814-
if(trim($lines[$l]) == '') {
814+
/* Trim only in headers */
815+
if($inHeader && trim($lines[$l]) == '') {
815816
$inHeader = false;
816817
continue;
817818
}

0 commit comments

Comments
 (0)