Fix account creation email
This commit is contained in:
parent
054e65b78f
commit
6a996c7c0c
|
@ -38,7 +38,7 @@ class AccountCreated extends Notification implements ShouldQueue
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $token;
|
public $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new notification instance.
|
* Create a new notification instance.
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
namespace Pterodactyl\Observers;
|
namespace Pterodactyl\Observers;
|
||||||
|
|
||||||
|
use DB;
|
||||||
use Pterodactyl\Events;
|
use Pterodactyl\Events;
|
||||||
use Pterodactyl\Models\User;
|
use Pterodactyl\Models\User;
|
||||||
use Pterodactyl\Notifications\AccountCreated;
|
use Pterodactyl\Notifications\AccountCreated;
|
||||||
|
@ -51,10 +52,11 @@ class UserObserver
|
||||||
{
|
{
|
||||||
event(new Events\User\Created($user));
|
event(new Events\User\Created($user));
|
||||||
|
|
||||||
|
$token = DB::table('password_resets')->where('email', $user->email)->orderBy('created_at', 'desc')->first();
|
||||||
$user->notify((new AccountCreated([
|
$user->notify((new AccountCreated([
|
||||||
'name' => $user->name_first,
|
'name' => $user->name_first,
|
||||||
'username' => $user->username,
|
'username' => $user->username,
|
||||||
'token' => DB::table('password_resets')->where('email', $user->email)->orderBy('created_at', 'desc')->first(),
|
'token' => (! is_null($token)) ? $token->token : null,
|
||||||
])));
|
])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue