2017-02-18 01:23:27 +01:00
|
|
|
<?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;
|
|
|
|
|
2022-10-14 18:59:20 +02:00
|
|
|
public object $server;
|
2017-02-18 01:23:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new notification instance.
|
|
|
|
*/
|
|
|
|
public function __construct(array $server)
|
|
|
|
{
|
|
|
|
$this->server = (object) $server;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the notification's delivery channels.
|
|
|
|
*/
|
2022-10-14 18:59:20 +02:00
|
|
|
public function via(): array
|
2017-02-18 01:23:27 +01:00
|
|
|
{
|
|
|
|
return ['mail'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the mail representation of the notification.
|
|
|
|
*/
|
2022-10-14 18:59:20 +02:00
|
|
|
public function toMail(): MailMessage
|
2017-02-18 01:23:27 +01:00
|
|
|
{
|
2021-01-23 21:33:34 +01:00
|
|
|
return (new MailMessage())
|
2017-02-18 01:23:27 +01:00
|
|
|
->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)
|
2020-05-09 01:31:20 +02:00
|
|
|
->action('Visit Server', url('/server/' . $this->server->uuidShort));
|
2017-02-18 01:23:27 +01:00
|
|
|
}
|
|
|
|
}
|