Add notification on card assignment to user

Signed-off-by: Steav <steav8@gmail.com>
This commit is contained in:
Steav
2018-07-22 13:41:56 +02:00
committed by Julius Härtl
parent a4044eff30
commit 77472b978d
7 changed files with 43 additions and 1 deletions

View File

@@ -73,6 +73,18 @@ class Notifier implements INotifier {
$params = $notification->getSubjectParameters();
switch ($notification->getSubject()) {
case 'card-assigned':
$cardId = $notification->getObjectId();
$boardId = $this->cardMapper->findBoardId($cardId);
$initiator = $this->userManager->get($params[2]);
if ($initiator !== null) {
$params[2] = $initiator->getDisplayName();
}
$notification->setParsedSubject(
(string) $l->t('The card "%s" on "%s" has been assigned to you by %s.', $params)
);
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '//card/' . $cardId . '');
break;
case 'card-overdue':
$cardId = $notification->getObjectId();
$boardId = $this->cardMapper->findBoardId($cardId);