Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

pterodactyl/panel

8314 stars
2 code files
View pterodactyl/panel on GitHub

app/Notifications/AccountCreated.php

Open in GitHub
use Pterodactyl\Models\User;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
 
class AccountCreated extends Notification
{
//
public function via($notifiable)
{
return ['mail'];
}
 
public function toMail($notifiable)
{
$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;
}
}

app/Services/Users/UserCreationService.php

Open in GitHub
use Pterodactyl\Notifications\AccountCreated;
use Pterodactyl\Contracts\Repository\UserRepositoryInterface;
 
class UserCreationService
{
public function handle(array $data)
{
//
$user = $this->repository->create(array_merge($data, [
'uuid' => Uuid::uuid4()->toString(),
]), true, true);
//
$this->connection->commit();
$user->notify(new AccountCreated($user, $token ?? null));
//
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.