mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
3847a76134
- This ensures content notifications are not translated to receiver language. - This adds actual plaintext support for content notifications (Was previously just HTML as text view). - Shares same base class across all mail notifications. - Also cleaned up existing notification classes. Future cleanup requested via #4501
27 lines
849 B
PHP
27 lines
849 B
PHP
<?php
|
|
|
|
namespace BookStack\Notifications;
|
|
|
|
use BookStack\Users\Models\User;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
class UserInvite extends MailNotification
|
|
{
|
|
public function __construct(
|
|
public string $token
|
|
) {
|
|
}
|
|
|
|
public function toMail(User $notifiable): MailMessage
|
|
{
|
|
$appName = ['appName' => setting('app-name')];
|
|
$language = $notifiable->getLanguage();
|
|
|
|
return $this->newMailMessage($language)
|
|
->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('/register/invite/' . $this->token));
|
|
}
|
|
}
|