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

@@ -94,6 +94,24 @@ class NotificationHelper {
$this->cardMapper->markNotified($card);
}
public function sendCardAssigned($card, $userId) {
$boardId = $this->cardMapper->findBoardId($card->getId());
$board = $this->getBoard($boardId);
$notification = $this->notificationManager->createNotification();
$notification
->setApp('deck')
->setUser((string) $userId)
->setDateTime(new DateTime())
->setObject('card', $card->getId())
->setSubject('card-assigned', [
$card->getTitle(),
$board->getTitle(),
$this->currentUser
]);
$this->notificationManager->notify($notification);
}
/**
* Send notifications that a board was shared with a user/group
*