Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

BookStackApp/BookStack

17759 stars
2 code files
View BookStackApp/BookStack on GitHub

app/Notifications/UserInvite.php

Open in GitHub
class UserInvite extends MailNotification
{
public $token;
 
public function __construct($token)
{
$this->token = $token;
}
 
public function toMail($notifiable)
{
$appName = ['appName' => setting('app-name')];
 
return $this->newMailMessage()
->subject(trans('auth.user_invite_email_subject', $appName))
->greeting(trans('auth.user_invite_email_greeting', $appName))
->line(trans('auth.user_invite_email_text'))
->action(trans('auth.user_invite_email_action'), url('/register/invite/' . $this->token));
}
}

app/Auth/Access/UserInviteService.php

Open in GitHub
use BookStack\Auth\User;
use BookStack\Notifications\UserInvite;
 
class UserInviteService extends UserTokenService
{
protected $tokenTable = 'user_invites';
protected $expiryTime = 336; // Two weeks
 
public function sendInvitation(User $user)
{
$this->deleteByUser($user);
$token = $this->createTokenForUser($user);
$user->notify(new UserInvite($token));
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.