mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-03 16:48:58 +02:00
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
class AccountCreated extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
/**
|
|
* Create a new notification instance.
|
|
*/
|
|
public function __construct(public User $user, public ?string $token = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*/
|
|
public function via(): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
/**
|
|
* Get the mail representation of the notification.
|
|
*/
|
|
public function toMail(): MailMessage
|
|
{
|
|
$message = (new MailMessage())
|
|
->greeting('Hello '.$this->user->name.'!')
|
|
->line('You are receiving this email because an account has been created for you on '.config('app.name').'.')
|
|
->line('Username: '.$this->user->username)
|
|
->line('Email: '.$this->user->email);
|
|
|
|
if (!is_null($this->token)) {
|
|
return $message->action('Setup Your Account', url('/auth/password/reset/'.$this->token.'?email='.urlencode($this->user->email)));
|
|
}
|
|
|
|
return $message;
|
|
}
|
|
}
|