mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
move sending notification mail into Notification Service
This commit is contained in:
parent
4d84aa2ce2
commit
acf85728c3
|
@ -432,6 +432,27 @@ class SeedDMS_NotificationService {
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This notification is sent when a new attachment is created.
|
||||||
|
*/
|
||||||
|
public function sendDeleteFileMail($file, $user) { /* {{{ */
|
||||||
|
$document = $file->getDocument();
|
||||||
|
$notifyList = $document->getNotifyList();
|
||||||
|
|
||||||
|
$subject = "removed_file_email_subject";
|
||||||
|
$message = "removed_file_email_body";
|
||||||
|
$params = array();
|
||||||
|
$params['document'] = $document->getName();
|
||||||
|
$params['username'] = $user->getFullName();
|
||||||
|
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||||
|
$params['sitename'] = $this->settings->_siteName;
|
||||||
|
$params['http_root'] = $this->settings->_httpRoot;
|
||||||
|
$this->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
|
foreach ($notifyList["groups"] as $grp) {
|
||||||
|
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
public function sendChangedExpiryMail($document, $user, $oldexpires) { /* {{{ */
|
public function sendChangedExpiryMail($document, $user, $oldexpires) { /* {{{ */
|
||||||
$folder = $document->getFolder();
|
$folder = $document->getFolder();
|
||||||
$notifyList = $document->getNotifyList();
|
$notifyList = $document->getNotifyList();
|
||||||
|
|
|
@ -68,20 +68,7 @@ if (!$document->removeDocumentFile($fileid)) {
|
||||||
} else {
|
} else {
|
||||||
// Send notification to subscribers.
|
// Send notification to subscribers.
|
||||||
if($notifier) {
|
if($notifier) {
|
||||||
$notifyList = $document->getNotifyList();
|
$notifier->sendDeleteFileMail($file, $user);
|
||||||
|
|
||||||
$subject = "removed_file_email_subject";
|
|
||||||
$message = "removed_file_email_body";
|
|
||||||
$params = array();
|
|
||||||
$params['document'] = $document->getName();
|
|
||||||
$params['username'] = $user->getFullName();
|
|
||||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
|
||||||
$params['sitename'] = $settings->_siteName;
|
|
||||||
$params['http_root'] = $settings->_httpRoot;
|
|
||||||
$notifier->toList($user, $notifyList["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
|
||||||
foreach ($notifyList["groups"] as $grp) {
|
|
||||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user