Commit 2ce66fe6007bbb91286cbbb3dfd08017d8a1415a
1 parent
7a1a7c5c
KTS-341: workflow notifications don't respect email preferences.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4892 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
12 additions
and
1 deletions
lib/dashboard/Notification.inc.php
| ... | ... | @@ -341,7 +341,18 @@ class KTWorkflowNotification extends KTNotificationHandler { |
| 341 | 341 | $aInfo['iUserId'] = $oUser->getId(); |
| 342 | 342 | $aInfo['sLabel'] = $oDocument->getName(); |
| 343 | 343 | |
| 344 | - return KTNotification::createFromArray($aInfo); | |
| 344 | + $oNotification = KTNotification::createFromArray($aInfo); | |
| 345 | + | |
| 346 | + $handler = new KTWorkflowNotification(); | |
| 347 | + | |
| 348 | + if ($oUser->getEmailNotification() && (strlen($oUser->getEmail()) > 0)) { | |
| 349 | + $emailContent = $handler->handleNotification($oNotification); | |
| 350 | + $emailSubject = sprintf(_('Workflow Notification: %s'), $oDocument->getName()); | |
| 351 | + $oEmail = new EmailAlert($oUser->getEmail(), $emailSubject, $emailContent); | |
| 352 | + $oEmail->send(); | |
| 353 | + } | |
| 354 | + | |
| 355 | + return $oNotification; | |
| 345 | 356 | } |
| 346 | 357 | |
| 347 | 358 | function handleNotification($oKTNotification) { | ... | ... |