diff --git a/CHANGELOG.md b/CHANGELOG.md index bbbdd24f0..81bb1d5a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. * Fixes server console resize handler to no longer encounter an exception at random that breaks the entire UI. * Fixes unhandled error caused by entering an invalid IP address or FQDN when creating a new node allocation. * Fixes unhandled error when Wings would fetch a server configuration from the Panel that uses an Egg with invalid JSON data for the configuration fields. +* Fixes email not being sent to a user when their server is done installing. ### Added * Adds support for automatically copying SFTP connection details when clicking into the text field. diff --git a/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php b/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php index 4e3364d8b..cd5165306 100644 --- a/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php +++ b/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php @@ -8,18 +8,22 @@ use Pterodactyl\Models\Server; use Illuminate\Http\JsonResponse; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\Eloquent\ServerRepository; +use Pterodactyl\Events\Server\Installed as ServerInstalled; +use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; use Pterodactyl\Http\Requests\Api\Remote\InstallationDataRequest; class ServerInstallController extends Controller { private ServerRepository $repository; + private EventDispatcher $eventDispatcher; /** * ServerInstallController constructor. */ - public function __construct(ServerRepository $repository) + public function __construct(ServerRepository $repository, EventDispatcher $eventDispatcher) { $this->repository = $repository; + $this->eventDispatcher = $eventDispatcher; } /** @@ -56,6 +60,11 @@ class ServerInstallController extends Controller $this->repository->update($server->id, ['status' => $status], true, true); + // If the server successfully installed, fire installed event. + if ($status === null) { + $this->eventDispatcher->dispatch(new ServerInstalled($server)); + } + return new Response('', Response::HTTP_NO_CONTENT); } } diff --git a/resources/scripts/components/dashboard/DashboardContainer.tsx b/resources/scripts/components/dashboard/DashboardContainer.tsx index 2edc06056..72357fd65 100644 --- a/resources/scripts/components/dashboard/DashboardContainer.tsx +++ b/resources/scripts/components/dashboard/DashboardContainer.tsx @@ -35,7 +35,7 @@ export default () => { {rootAdmin &&

- {showOnlyAdmin ? 'Showing other\'s servers' : 'Showing your servers'} + {showOnlyAdmin ? 'Showing others\' servers' : 'Showing your servers'}