Files
panel/app/Notifications/AddedToServer.php

36 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
2024-03-12 22:39:16 -04:00
namespace App\Notifications;
2025-04-14 12:57:38 +02:00
use App\Filament\Server\Pages\Console;
use App\Models\Server;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
2025-09-24 13:34:19 +02:00
use Illuminate\Notifications\Notification;
class AddedToServer 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
{
$locale = $notifiable->language ?? 'en';
2021-01-23 12:33:34 -08:00
return (new MailMessage())
->greeting(trans('mail.greeting', ['name' => $notifiable->username], $locale))
->line(trans('mail.added_to_server.body', locale: $locale))
->line(trans('mail.added_to_server.server_name', ['name' => $this->server->name], $locale))
->action(trans('mail.added_to_server.action', locale: $locale), Console::getUrl(panel: 'server', tenant: $this->server));
}
}