mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
do send mail to disabled users or guests
This commit is contained in:
parent
99bc6becb6
commit
bbcf7cb979
|
@ -37,25 +37,27 @@ class SeedDMS_ExpiredDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ */
|
|||
if(!empty($taskparams['peruser'])) {
|
||||
$users = $dms->getAllUsers();
|
||||
foreach($users as $u) {
|
||||
$docs = $dms->getDocumentsExpired(intval($taskparams['days']), $u);
|
||||
if (count($docs)>0) {
|
||||
$bodyhtml .= "<table>".PHP_EOL;
|
||||
$bodyhtml .= sprintf($tableformatheadhtml."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
||||
$body .= sprintf($tableformathead."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
||||
$body .= "---------------------------------------------------------------------------------\n";
|
||||
foreach($docs as $doc) {
|
||||
$body .= sprintf($tableformat."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||
$bodyhtml .= sprintf($tableformathtml."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||
}
|
||||
$bodyhtml .= "</table>".PHP_EOL;
|
||||
$params = array();
|
||||
$params['count'] = count($docs);
|
||||
$params['__body__'] = $body;
|
||||
$params['__body_html__'] = $bodyhtml;
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$email->toIndividual('', $u, 'expired_docs_mail_subject', '', $params);
|
||||
if(!$u->isGuest() && !$u->isDisabled()) {
|
||||
$docs = $dms->getDocumentsExpired(intval($taskparams['days']), $u);
|
||||
if (count($docs)>0) {
|
||||
$bodyhtml .= "<table>".PHP_EOL;
|
||||
$bodyhtml .= sprintf($tableformatheadhtml."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
||||
$body .= sprintf($tableformathead."\n", getMLText("expires", array(), ""), "ID", getMLText("name", array(), ""));
|
||||
$body .= "---------------------------------------------------------------------------------\n";
|
||||
foreach($docs as $doc) {
|
||||
$body .= sprintf($tableformat."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||
$bodyhtml .= sprintf($tableformathtml."\n", getReadableDate($doc->getExpires()), $doc->getId(), $doc->getName());
|
||||
}
|
||||
$bodyhtml .= "</table>".PHP_EOL;
|
||||
$params = array();
|
||||
$params['count'] = count($docs);
|
||||
$params['__body__'] = $body;
|
||||
$params['__body_html__'] = $bodyhtml;
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$email->toIndividual('', $u, 'expired_docs_mail_subject', '', $params);
|
||||
|
||||
$logger->log('Task \'expired_docs\': Sending reminder \'expired_docs_mail_subject\' to user \''.$u->getLogin().'\'', PEAR_LOG_INFO);
|
||||
$logger->log('Task \'expired_docs\': Sending reminder \'expired_docs_mail_subject\' to user \''.$u->getLogin().'\'', PEAR_LOG_INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif($taskparams['email']) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user