mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-26 09:53:20 +01:00
* notification/email: support filter since (only check unseen mails for the last 14 days) when notify for unseen mails
This commit is contained in:
parent
7d773f6f48
commit
ae535d8be0
@ -389,7 +389,7 @@
|
||||
case 'BEFORE':
|
||||
case 'ON':
|
||||
case 'SINCE':
|
||||
$imapFilter .= $criteria .' "'. date() .'" ';
|
||||
$imapFilter .= $criteria .' '. $_criterias['string'].' ';
|
||||
break;
|
||||
}
|
||||
#}
|
||||
|
@ -153,7 +153,12 @@ class notifications_ajax {
|
||||
$this->session_data['notified_mail_uids'][$notify_folder] = array();
|
||||
}
|
||||
$folder_status[$notify_folder] = $bofelamimail->getFolderStatus($notify_folder);
|
||||
$headers = $bofelamimail->getHeaders($notify_folder, 1, false, 0, true, array('status'=>'UNSEEN'));
|
||||
$cutoffdate = time();
|
||||
$cutoffdate = $cutoffdate - (60*60*24*14); // last 14 days
|
||||
$_filter = array('status'=>'UNSEEN','type'=>"SINCE",'string'=> date("d-M-Y", $cutoffdate));
|
||||
//error_log(__METHOD__.__LINE__.' (user: '.$this->recipient->account_lid.') Mailbox:'.$notify_folder.' filter:'.array2string($_filter));
|
||||
// $_folderName, $_startMessage, $_numberOfMessages, $_sort, $_reverse, $_filter, $_thisUIDOnly=null, $_cacheResult=true
|
||||
$headers = $bofelamimail->getHeaders($notify_folder, 1, 999, 0, true, $_filter);
|
||||
if(is_array($headers['header']) && count($headers['header']) > 0) {
|
||||
foreach($headers['header'] as $id=>$header) {
|
||||
// check if unseen mail has already been notified
|
||||
|
Loading…
Reference in New Issue
Block a user