mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +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) { /* {{{ */
|
||||
$folder = $document->getFolder();
|
||||
$notifyList = $document->getNotifyList();
|
||||
|
|
|
@ -68,20 +68,7 @@ if (!$document->removeDocumentFile($fileid)) {
|
|||
} else {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$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().$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);
|
||||
}
|
||||
$notifier->sendDeleteFileMail($file, $user);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user