Files
panel/app/Notifications/ServerInstalled.php

34 lines
950 B
PHP
Raw Normal View History

<?php
2024-03-12 22:39:16 -04:00
namespace App\Notifications;
2024-03-12 22:39:16 -04:00
use App\Models\User;
use Illuminate\Bus\Queueable;
2024-03-12 22:39:16 -04:00
use App\Models\Server;
2025-01-06 19:58:32 +02:00
use App\Filament\App\Resources\ServerResource\Pages\ListServers;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
2024-03-16 23:20:58 -04:00
class ServerInstalled extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(public Server $server) {}
/** @return string[] */
public function via(): array
{
return ['mail'];
}
public function toMail(User $notifiable): MailMessage
{
2021-01-23 12:33:34 -08:00
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)
2025-01-06 19:58:32 +02:00
->action('Login and Begin Using', ListServers::getUrl());
}
}