diff options
author | dartcafe <github@dartcafe.de> | 2020-11-17 22:16:41 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-11-19 10:20:57 +0300 |
commit | 7774dfc70913b384e8536fa11537071e155802d0 (patch) | |
tree | aab357525ad5dfc7fe6f8bf010ba83f75c542bf2 /lib/Controller/ShareController.php | |
parent | 35e9c02a9a4058bb1b007b3f2c8a516f370f8794 (diff) |
add groups notification
Diffstat (limited to 'lib/Controller/ShareController.php')
-rw-r--r-- | lib/Controller/ShareController.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index c866bf33..f902c8ff 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -172,10 +172,13 @@ class ShareController extends Controller { return $this->response(function () use ($token) { $share = $this->shareService->get($token); if ($share->getType() === Share::TYPE_USER) { - if ($this->notificationService->sendInvitation($share->getPollId(), $share->getUserId())) { + $this->notificationService->sendInvitation($share->getPollId(), $share->getUserId()); // skip this atm, to send invitations as mail too, if user is a site user // $sentResult = ['sentMails' => [new User($share->getuserId())]]; // $this->shareService->setInvitationSent($token); + } elseif ($share->getType() === Share::TYPE_GROUP) { + foreach ($share->getMembers() as $member) { + $this->notificationService->sendInvitation($share->getPollId(), $member->getId()); } } $sentResult = $this->mailService->sendInvitation($token); |