Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Do not over-summarize notifications in email digest. Fix #1123
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 28, 2016
1 parent 53acaff commit 3b965cb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/src/plugins/core.mailer/class.AjxpMailer.php
Expand Up @@ -105,7 +105,18 @@ public function mailConsumeQueue ($action, $httpVars, $fileVars) {
$key = key($arrayAjxpKey);
$body = $body . '<h1>' . $arrayAjxpKey[$key][0]->getDescriptionLocation() . ', </h1><ul>';
foreach ($arrayAjxpKey as $ajxpKey => $arrayNotif) {
$body = $body . '<li>' . $arrayNotif[0]->getDescriptionLong(true) . ' (' . count($arrayNotif) . ')</li>';
$descs = array();
foreach($arrayNotif as $notif){
$desc = $notif->getDescriptionLong(true);
if(array_key_exists($desc, $descs)){
$descs[$desc] ++;
}else{
$descs[$desc] = 1;
}
}
foreach($descs as $sentence => $occurences){
$body = $body . '<li>' . $sentence . ($occurences > 1 ? ' ('.count($arrayNotif).')' :'').'</li>';
}
}
$body = $body . '</ul>';
}
Expand Down

0 comments on commit 3b965cb

Please sign in to comment.