X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3b31ac75ec41b3990cea770a9e48e2066bd8e9a3..refs/pull/5721/head:/app/Access/UserInviteService.php diff --git a/app/Access/UserInviteService.php b/app/Access/UserInviteService.php index 00e361e82..0b24eb0d9 100644 --- a/app/Access/UserInviteService.php +++ b/app/Access/UserInviteService.php @@ -2,7 +2,7 @@ namespace BookStack\Access; -use BookStack\Notifications\UserInvite; +use BookStack\Access\Notifications\UserInviteNotification; use BookStack\Users\Models\User; class UserInviteService extends UserTokenService @@ -13,11 +13,17 @@ class UserInviteService extends UserTokenService /** * Send an invitation to a user to sign into BookStack * Removes existing invitation tokens. + * @throws UserInviteException */ public function sendInvitation(User $user) { $this->deleteByUser($user); $token = $this->createTokenForUser($user); - $user->notify(new UserInvite($token)); + + try { + $user->notify(new UserInviteNotification($token)); + } catch (\Exception $exception) { + throw new UserInviteException($exception->getMessage(), $exception->getCode(), $exception); + } } }