BookStack/app/Access/Notifications/UserInviteNotification.php

28 lines
882 B
PHP
Raw Normal View History

2021-06-26 23:23:15 +08:00
<?php
namespace BookStack\Access\Notifications;
2019-08-17 22:52:33 +08:00
use BookStack\App\MailNotification;
2023-05-18 00:56:55 +08:00
use BookStack\Users\Models\User;
use Illuminate\Notifications\Messages\MailMessage;
class UserInviteNotification extends MailNotification
2019-08-17 22:52:33 +08:00
{
public function __construct(
public string $token
) {
2019-08-17 22:52:33 +08:00
}
public function toMail(User $notifiable): MailMessage
2019-08-17 22:52:33 +08:00
{
$appName = ['appName' => setting('app-name')];
$locale = $notifiable->getLocale();
2021-06-26 23:23:15 +08: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 22:52:33 +08:00
}
}