Skip to content

Commit 6a996c7

Browse files
committed
Fix account creation email
1 parent 054e65b commit 6a996c7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/Notifications/AccountCreated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AccountCreated extends Notification implements ShouldQueue
3838
*
3939
* @var string
4040
*/
41-
public $token;
41+
public $user;
4242

4343
/**
4444
* Create a new notification instance.

app/Observers/UserObserver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
namespace Pterodactyl\Observers;
2626

27+
use DB;
2728
use Pterodactyl\Events;
2829
use Pterodactyl\Models\User;
2930
use Pterodactyl\Notifications\AccountCreated;
@@ -51,10 +52,11 @@ public function created(User $user)
5152
{
5253
event(new Events\User\Created($user));
5354

55+
$token = DB::table('password_resets')->where('email', $user->email)->orderBy('created_at', 'desc')->first();
5456
$user->notify((new AccountCreated([
5557
'name' => $user->name_first,
5658
'username' => $user->username,
57-
'token' => DB::table('password_resets')->where('email', $user->email)->orderBy('created_at', 'desc')->first(),
59+
'token' => (! is_null($token)) ? $token->token : null,
5860
])));
5961
}
6062

0 commit comments

Comments
 (0)