pelican-panel-mirror/app/Notifications/ServerInstalled.php
Boy132 513117cc42
Fix event listeners for notifications (#971)
* fix event listeners for notifications

* fix "visit panel" url
2025-02-08 14:32:56 +01:00

33 lines
922 B
PHP

<?php
namespace App\Notifications;
use App\Models\User;
use Illuminate\Bus\Queueable;
use App\Models\Server;
use App\Filament\App\Resources\ServerResource\Pages\ListServers;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ServerInstalled extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(public Server $server) {}
public function via(): array
{
return ['mail'];
}
public function toMail(User $notifiable): MailMessage
{
return (new MailMessage())
->greeting('Hello ' . $notifiable->username . '.')
->line('Your server has finished installing and is now ready for you to use.')
->line('Server Name: ' . $this->server->name)
->action('Login and Begin Using', ListServers::getUrl());
}
}