update mail template and module

This commit is contained in:
Marion Muszynski 2016-03-29 17:33:15 +02:00
parent ba8fa44d2f
commit e1e40f0458
3 changed files with 34 additions and 17 deletions

View File

@ -1,15 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message Alert Problèmes techniques</title>
</head>
<body>
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 100%;">
<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}.</td>
</tr>
<tr><td>&nbsp;</td></tr>
</table>
</body>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message Alert Problèmes techniques</title>
</head>
<body>
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 100%;">
<tr>
<td align="left">
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
</td>
</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>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
</td>
</tr>
</table>
</body>
</html>

View File

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

View File

@ -72,9 +72,8 @@ class Ant_Alert extends Module
$date = new Datetime(Configuration::get('ANT_ALTER_DATESEND'));
$now = new Datetime;
//$dteDiff = $date->diff($now);
//if ((int)$dteDiff->format("%H") > (int)Configuration::get('ANT_ALTER_HOURS')) {
if (true) { // dev
$dteDiff = $date->diff($now);
if ((int)$dteDiff->format("%H") >= (int)Configuration::get('ANT_ALTER_HOURS')) { // prod
$open_messages = Db::getInstance()->getRow('
SELECT COUNT(*) as total
FROM '._DB_PREFIX_.'customer_thread ct
@ -82,7 +81,14 @@ class Ant_Alert extends Module
GROUP BY ct.id_contact HAVING COUNT(*) > 0 AND ct.id_contact = 4'
);
if ((int)$open_messages['total'] >= (int)Configuration::get('ANT_ALTER_LIMIT')) {
$to = array('marion@antadis.com');
// dev
$to = array('marion@antadis.com');
// prod
/*$to = array(
'frederic@bebeboutik.com',
'jacques@bebeboutik.com',
'valentin@bebeboutik.com'
);*/
$data = array(
'{limit}' => (int)Configuration::get('ANT_ALTER_LIMIT'),
'{hours}' => (int)Configuration::get('ANT_ALTER_HOURS'),