mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
WIP notifications and other refactors (#88)
* WIP notifications and other refactors - refactor notification channels - send notifications on events related to the servers and sites - delete server log files on server deletion - add telegram notification channel - add new icons - cache configs and icons on installation and updates - new navbar for dark mode and settings * discord channel * build assets * pint
This commit is contained in:
@ -2,12 +2,11 @@
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Contracts\Notification;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
|
||||
class FailedToDeleteServerFromProvider implements Notification
|
||||
class FailedToDeleteServerFromProvider extends AbstractNotification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
@ -18,26 +17,18 @@ public function __construct(Server $server)
|
||||
$this->server = $server;
|
||||
}
|
||||
|
||||
public function subject(): string
|
||||
public function rawText(): string
|
||||
{
|
||||
return __('Failed to delete the server from the provider!');
|
||||
}
|
||||
|
||||
public function message(bool $mail = false): mixed
|
||||
{
|
||||
if ($mail) {
|
||||
return $this->mail();
|
||||
}
|
||||
|
||||
return __("We couldn't delete [:server] \nfrom :provider \nPlease check your provider and delete it manually", [
|
||||
'server' => $this->server->name,
|
||||
'provider' => $this->server->provider,
|
||||
]);
|
||||
}
|
||||
|
||||
public function mail(): MailMessage
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
return (new MailMessage)
|
||||
->subject(__('Failed to delete the server from the provider!'))
|
||||
->line("We couldn't delete [".$this->server->name.'] from '.$this->server->provider)
|
||||
->line('Please check your provider and delete it manually');
|
||||
}
|
||||
|
Reference in New Issue
Block a user