Path: blob/1.0-develop/app/Notifications/AccountCreated.php
7432 views
<?php12namespace Pterodactyl\Notifications;34use Pterodactyl\Models\User;5use Illuminate\Bus\Queueable;6use Illuminate\Notifications\Notification;7use Illuminate\Contracts\Queue\ShouldQueue;8use Illuminate\Notifications\Messages\MailMessage;910class AccountCreated extends Notification implements ShouldQueue11{12use Queueable;1314/**15* Create a new notification instance.16*/17public function __construct(public User $user, public ?string $token = null)18{19}2021/**22* Get the notification's delivery channels.23*/24public function via(): array25{26return ['mail'];27}2829/**30* Get the mail representation of the notification.31*/32public function toMail(): MailMessage33{34$message = (new MailMessage())35->greeting('Hello ' . $this->user->name . '!')36->line('You are receiving this email because an account has been created for you on ' . config('app.name') . '.')37->line('Username: ' . $this->user->username)38->line('Email: ' . $this->user->email);3940if (!is_null($this->token)) {41return $message->action('Setup Your Account', url('/auth/password/reset/' . $this->token . '?email=' . urlencode($this->user->email)));42}4344return $message;45}46}474849