Better user creation email.

This commit is contained in:
Dane Everitt 2017-02-17 18:48:57 -05:00
parent 3240601d03
commit 95171a3e41
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 14 additions and 20 deletions

View file

@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
### Changed
* `[pre.2]` — File Manager now displays relevant information on all screen sizes, and includes better button clicking mechanics for dropdown menu.
* Reduced the number of database queries being executed when viewing a specific server. This is done by caching the query for up to 60 minutes in memcached.
* User creation emails include more information and are sent by the event listener rather than the repository.
## v0.6.0-pre.2 (Courageous Carniadactylus)
### Fixed

View file

@ -45,9 +45,9 @@ class AccountCreated extends Notification implements ShouldQueue
*
* @return void
*/
public function __construct($token)
public function __construct(array $user)
{
$this->token = $token;
$this->user = $user;
}
/**
@ -70,8 +70,10 @@ class AccountCreated extends Notification implements ShouldQueue
public function toMail($notifiable)
{
return (new MailMessage)
->greeting('Hello ' . $this->user->name . '!')
->line('You are recieving this email because an account has been created for you on Pterodactyl Panel.')
->line('Username: ' . $this->user->username)
->line('Email: ' . $notifiable->email)
->action('Setup Your Account', url('/auth/password/reset/' . $this->token . '?email=' . $notifiable->email));
->action('Setup Your Account', url('/auth/password/reset/' . $this->user->token . '?email=' . $notifiable->email));
}
}

View file

@ -75,17 +75,4 @@ class SendPasswordReset extends Notification implements ShouldQueue
->action('Reset Password', url('auth/password/reset', $this->token))
->line('If you did not request a password reset, no further action is required.');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}

View file

@ -49,6 +49,12 @@ class UserObserver
public function created(User $user)
{
event(new Events\User\Created($user));
$user->notify((new AccountCreated([
'name' => $user->name_first,
'username' => $user->username,
'token' => DB::table('password_resets')->where('email', $user->email)->orderBy('created_at', 'desc')->first(),
])));
}
/**

View file

@ -105,8 +105,6 @@ class UserRepository
'token' => $token,
'created_at' => Carbon::now()->toDateTimeString(),
]);
$user->notify((new AccountCreated($token)));
}
DB::commit();