mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-25 18:42:31 +01:00
cbcf62086f
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Pterodactyl\Notifications;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
class AddedToServer extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public object $server;
|
|
|
|
/**
|
|
* Create a new notification instance.
|
|
*/
|
|
public function __construct(array $server)
|
|
{
|
|
$this->server = (object) $server;
|
|
}
|
|
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*/
|
|
public function via(): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
/**
|
|
* Get the mail representation of the notification.
|
|
*/
|
|
public function toMail(): MailMessage
|
|
{
|
|
return (new MailMessage())
|
|
->greeting('Hello ' . $this->server->user . '!')
|
|
->line('You have been added as a subuser for the following server, allowing you certain control over the server.')
|
|
->line('Server Name: ' . $this->server->name)
|
|
->action('Visit Server', url('/server/' . $this->server->uuidShort));
|
|
}
|
|
}
|