File tree Expand file tree Collapse file tree 3 files changed +20
-18
lines changed
Expand file tree Collapse file tree 3 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,12 @@ public function via($notifiable)
6666 public function toMail ($ notifiable )
6767 {
6868 return (new MailMessage )
69- ->line ('A new server as been assigned to your account. ' )
70- ->line ('Server Name: ' . $ this ->server ->name )
71- ->line ('Memory: ' . $ this ->server ->memory . ' MB ' )
72- ->line ('Node: ' . $ this ->server ->node )
73- ->line ('Type: ' . $ this ->server ->service . ' - ' . $ this ->server ->option )
74- ->action ('Peel Off the Protective Wrap ' , route ('server.index ' , $ this ->server ->uuidShort ))
75- ->line ('Please let us know if you have any additional questions or concerns! ' );
69+ ->line ('A new server as been assigned to your account. ' )
70+ ->line ('Server Name: ' . $ this ->server ->name )
71+ ->line ('Memory: ' . $ this ->server ->memory . ' MB ' )
72+ ->line ('Node: ' . $ this ->server ->node )
73+ ->line ('Type: ' . $ this ->server ->service . ' - ' . $ this ->server ->option )
74+ ->action ('Peel Off the Protective Wrap ' , route ('server.index ' , $ this ->server ->uuidShort ))
75+ ->line ('Please let us know if you have any additional questions or concerns! ' );
7676 }
7777}
Original file line number Diff line number Diff line change 2626
2727use Carbon ;
2828use Pterodactyl \Events ;
29+ use Pterodactyl \Models \User ;
2930use Pterodactyl \Models \Server ;
3031use Pterodactyl \Jobs \DeleteServer ;
3132use Pterodactyl \Jobs \SuspendServer ;
33+ use Pterodactyl \Notifications \ServerCreated ;
3234use Illuminate \Foundation \Bus \DispatchesJobs ;
3335
3436class ServerObserver
@@ -55,6 +57,17 @@ public function creating(Server $server)
5557 public function created (Server $ server )
5658 {
5759 event (new Events \Server \Created ($ server ));
60+
61+ // Queue Notification Email
62+ $ user = User::findOrFail ($ server ->owner );
63+ $ user ->notify ((new ServerCreated ([
64+ 'name ' => $ server ->name ,
65+ 'memory ' => $ server ->memory ,
66+ 'node ' => $ node ->name ,
67+ 'service ' => $ service ->name ,
68+ 'option ' => $ option ->name ,
69+ 'uuidShort ' => $ server ->uuidShort ,
70+ ])));
5871 }
5972
6073 /**
Original file line number Diff line number Diff line change 3232use Pterodactyl \Services \UuidService ;
3333use Pterodactyl \Services \DeploymentService ;
3434use Pterodactyl \Exceptions \DisplayException ;
35- use Pterodactyl \Notifications \ServerCreated ;
3635use Pterodactyl \Exceptions \DisplayValidationException ;
3736
3837class ServerRepository
@@ -300,16 +299,6 @@ public function create(array $data)
300299 ]);
301300 }
302301
303- // Queue Notification Email
304- $ user ->notify ((new ServerCreated ([
305- 'name ' => $ server ->name ,
306- 'memory ' => $ server ->memory ,
307- 'node ' => $ node ->name ,
308- 'service ' => $ service ->name ,
309- 'option ' => $ option ->name ,
310- 'uuidShort ' => $ server ->uuidShort ,
311- ])));
312-
313302 $ client = Models \Node::guzzleRequest ($ node ->id );
314303 $ client ->request ('POST ' , '/servers ' , [
315304 'headers ' => [
You can’t perform that action at this time.
0 commit comments