mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-22 17:12:30 +01:00
Remove server creation notification temporarily
This commit is contained in:
parent
ac2abd89e6
commit
5170bcf41a
@ -1,64 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
|
||||
class ServerCreated extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
public $server;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*
|
||||
* @param array $server
|
||||
*/
|
||||
public function __construct(array $server)
|
||||
{
|
||||
$this->server = (object) $server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
* @return \Illuminate\Notifications\Messages\MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
return (new MailMessage)
|
||||
->line('A new server as been assigned to your account.')
|
||||
->line('Server Name: ' . $this->server->name)
|
||||
->line('Memory: ' . $this->server->memory . ' MB')
|
||||
->line('Node: ' . $this->server->node)
|
||||
->line('Type: ' . $this->server->service . ' - ' . $this->server->option)
|
||||
->action('Peel Off the Protective Wrap', route('server.index', $this->server->uuidShort))
|
||||
->line('Please let us know if you have any additional questions or concerns!');
|
||||
}
|
||||
}
|
@ -9,10 +9,8 @@
|
||||
|
||||
namespace Pterodactyl\Observers;
|
||||
|
||||
use Cache;
|
||||
use Pterodactyl\Events;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Notifications\ServerCreated;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
|
||||
class ServerObserver
|
||||
@ -37,16 +35,6 @@ class ServerObserver
|
||||
public function created(Server $server)
|
||||
{
|
||||
event(new Events\Server\Created($server));
|
||||
|
||||
// Queue Notification Email
|
||||
$server->user->notify((new ServerCreated([
|
||||
'name' => $server->name,
|
||||
'memory' => $server->memory,
|
||||
'node' => $server->node->name,
|
||||
'service' => $server->service->name,
|
||||
'option' => $server->option->name,
|
||||
'uuidShort' => $server->uuidShort,
|
||||
])));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,17 +94,6 @@ class ServerObserver
|
||||
*/
|
||||
public function updated(Server $server)
|
||||
{
|
||||
/*
|
||||
* The cached byUuid model calls are tagged with Model:Server:byUuid:<uuid>
|
||||
* so that they can be accessed regardless of if there is an Auth::user()
|
||||
* defined or not.
|
||||
*
|
||||
* We can also delete all cached byUuid items using the Model:Server tag.
|
||||
*/
|
||||
Cache::tags('Model:Server:byUuid:' . $server->uuid)->flush();
|
||||
Cache::tags('Model:Server:byUuid:' . $server->uuidShort)->flush();
|
||||
Cache::tags('Downloads:Server:' . $server->uuid)->flush();
|
||||
|
||||
event(new Events\Server\Updated($server));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user