Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Notifications/AddedToServer.php
7432 views
1
<?php
2
3
namespace Pterodactyl\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Notifications\Notification;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
10
class AddedToServer extends Notification implements ShouldQueue
11
{
12
use Queueable;
13
14
public object $server;
15
16
/**
17
* Create a new notification instance.
18
*/
19
public function __construct(array $server)
20
{
21
$this->server = (object) $server;
22
}
23
24
/**
25
* Get the notification's delivery channels.
26
*/
27
public function via(): array
28
{
29
return ['mail'];
30
}
31
32
/**
33
* Get the mail representation of the notification.
34
*/
35
public function toMail(): MailMessage
36
{
37
return (new MailMessage())
38
->greeting('Hello ' . $this->server->user . '!')
39
->line('You have been added as a subuser for the following server, allowing you certain control over the server.')
40
->line('Server Name: ' . $this->server->name)
41
->action('Visit Server', url('/server/' . $this->server->uuidShort));
42
}
43
}
44
45