2021-06-26 11:23:15 -04:00
|
|
|
<?php
|
|
|
|
|
2023-09-11 14:26:28 -04:00
|
|
|
namespace BookStack\Access\Notifications;
|
2019-08-17 10:52:33 -04:00
|
|
|
|
2023-09-11 14:26:28 -04:00
|
|
|
use BookStack\App\MailNotification;
|
2023-05-17 12:56:55 -04:00
|
|
|
use BookStack\Users\Models\User;
|
2022-01-31 17:15:21 -05:00
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
|
2023-09-11 14:26:28 -04:00
|
|
|
class UserInviteNotification extends MailNotification
|
2019-08-17 10:52:33 -04:00
|
|
|
{
|
2023-09-02 10:11:42 -04:00
|
|
|
public function __construct(
|
|
|
|
public string $token
|
|
|
|
) {
|
2019-08-17 10:52:33 -04:00
|
|
|
}
|
|
|
|
|
2022-01-31 17:15:21 -05:00
|
|
|
public function toMail(User $notifiable): MailMessage
|
2019-08-17 10:52:33 -04:00
|
|
|
{
|
|
|
|
$appName = ['appName' => setting('app-name')];
|
2023-09-17 11:20:21 -04:00
|
|
|
$locale = $notifiable->getLocale();
|
2021-06-26 11:23:15 -04:00
|
|
|
|
2023-09-17 11:20:21 -04:00
|
|
|
return $this->newMailMessage($locale)
|
|
|
|
->subject($locale->trans('auth.user_invite_email_subject', $appName))
|
|
|
|
->greeting($locale->trans('auth.user_invite_email_greeting', $appName))
|
|
|
|
->line($locale->trans('auth.user_invite_email_text'))
|
|
|
|
->action($locale->trans('auth.user_invite_email_action'), url('/register/invite/' . $this->token));
|
2019-08-17 10:52:33 -04:00
|
|
|
}
|
|
|
|
}
|