X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c429cf78187e80deb63982a282a1c6889f30291a..refs/pull/3373/head:/app/Notifications/UserInvite.php diff --git a/app/Notifications/UserInvite.php b/app/Notifications/UserInvite.php index b0dc9afac..3bae32721 100644 --- a/app/Notifications/UserInvite.php +++ b/app/Notifications/UserInvite.php @@ -2,35 +2,33 @@ namespace BookStack\Notifications; +use BookStack\Auth\User; +use Illuminate\Notifications\Messages\MailMessage; + class UserInvite extends MailNotification { public $token; /** * Create a new notification instance. - * - * @param string $token */ - public function __construct($token) + public function __construct(string $token) { $this->token = $token; } /** * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail(User $notifiable): MailMessage { $appName = ['appName' => setting('app-name')]; + $language = setting()->getUser($notifiable, 'language'); 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('/http/source.bookstackapp.com/register/invite/' . $this->token)); + ->subject(trans('auth.user_invite_email_subject', $appName, $language)) + ->greeting(trans('auth.user_invite_email_greeting', $appName, $language)) + ->line(trans('auth.user_invite_email_text', [], $language)) + ->action(trans('auth.user_invite_email_action', [], $language), url('/http/source.bookstackapp.com/register/invite/' . $this->token)); } }