Merge branch 'ticket-13814-mailAlertUpdate' into develop

This commit is contained in:
Marion Muszynski 2017-08-22 11:57:31 +02:00
commit b283b18d74
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message Alert Problèmes techniques</title>
<title>Message Alert {contact}</title>
</head>
<body>
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 100%;">
@ -13,7 +13,7 @@
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left" style="background: #514c8c; color:#ffffff; font-size: 12px; font-weight:bold; padding: 0.5em 1em;">Vous avez reçu {limit} messages ou plus concernant des problèmes techniques en {hours}H.</td>
<td align="left" style="background: #514c8c; color:#ffffff; font-size: 12px; font-weight:bold; padding: 0.5em 1em;">Vous avez reçu {limit} messages ou plus concernant {contact} en {hours}H.</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>

View File

@ -1 +1 @@
Vous avez reçu {limit} messages ou plus concernant des problèmes techniques en {hours}H
Vous avez reçu {limit} messages ou plus concernant {contact} en {hours}H

View File

@ -89,7 +89,7 @@ class Ant_Alert extends Module
$alert = AntAlert::getAlertByContact((int)$params['id_contact']);
if($alert && $alert->enabled == 1) {
$date = new Datetime($alert->date_last_send);
$date = new Datetime($alert->date_last_sent);
$now = new Datetime;
$dteDiff = $date->diff($now);
@ -98,7 +98,7 @@ class Ant_Alert extends Module
SELECT COUNT(*) as total
FROM '._DB_PREFIX_.'customer_thread ct
WHERE ct.status = "open"
GROUP BY ct.id_contact HAVING COUNT(*) > 0 AND ct.id_contact ='.$alert->id_contact
GROUP BY ct.id_contact HAVING COUNT(*) > 0 AND ct.id_contact ='.(int)$alert->id_contact
);
if ((int)$open_messages['total'] >= (int)$alert->limit) {
// dev
@ -116,7 +116,7 @@ class Ant_Alert extends Module
'{contact}' => (int)$contact->name,
);
foreach ($to as $email) {
if(Mail::Send((int)$cookie->id_lang, 'ant_alert', 'Alert error', $data, $to)) {
if(Mail::Send(2, 'ant_alert', 'Alert error', $data, $to)) {
$alert->last_date_sent = date('Y-m-d H:i:s');
$alert->save();
}