2017-02-17 19:23:27 -05:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2017-02-17 19:23:27 -05:00
|
|
|
namespace Pterodactyl\Notifications;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
2026-10-05 18:10:18 -04:00
|
|
|
use Illuminate\Notifications\Notification;
|
2017-02-17 19:23:27 -05:00
|
|
|
|
|
|
|
|
class RemovedFromServer extends Notification implements ShouldQueue
|
|
|
|
|
{
|
|
|
|
|
use Queueable;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new notification instance.
|
2026-10-05 18:10:18 -04:00
|
|
|
*
|
|
|
|
|
* @param array{user: string, name: string} $server
|
2017-02-17 19:23:27 -05:00
|
|
|
*/
|
2026-10-05 18:10:18 -04:00
|
|
|
public function __construct(
|
|
|
|
|
public readonly array $server,
|
|
|
|
|
) {
|
|
|
|
|
$this->afterCommit();
|
2017-02-17 19:23:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the notification's delivery channels.
|
2026-10-05 18:10:18 -04:00
|
|
|
*
|
|
|
|
|
* @return list<string>
|
2017-02-17 19:23:27 -05:00
|
|
|
*/
|
2022-10-14 10:59:20 -06:00
|
|
|
public function via(): array
|
2017-02-17 19:23:27 -05:00
|
|
|
{
|
|
|
|
|
return ['mail'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the mail representation of the notification.
|
|
|
|
|
*/
|
2022-10-14 10:59:20 -06:00
|
|
|
public function toMail(): MailMessage
|
2017-02-17 19:23:27 -05:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
return (new MailMessage)
|
2017-02-17 19:23:27 -05:00
|
|
|
->error()
|
2026-11-23 14:51:03 +00:00
|
|
|
->subject(__('notifications.removed_from_server.subject'))
|
|
|
|
|
->greeting(__('notifications.removed_from_server.greeting', ['name' => $this->server['user']]))
|
|
|
|
|
->line(__('notifications.removed_from_server.intro'))
|
|
|
|
|
->line(__('notifications.removed_from_server.server', ['server' => $this->server['name']]))
|
|
|
|
|
->action(__('notifications.removed_from_server.action'), route('index'));
|
2017-02-17 19:23:27 -05:00
|
|
|
}
|
|
|
|
|
}
|