update
This commit is contained in:
@@ -17,7 +17,7 @@ class DiscordSettings extends Component
|
||||
'model.extra_attributes.discord_webhook' => 'required|url',
|
||||
];
|
||||
protected $validationAttributes = [
|
||||
'model.extra_attributes.discord_webhook' => '',
|
||||
'model.extra_attributes.discord_webhook' => 'Discord Webhook',
|
||||
];
|
||||
|
||||
public function instantSave()
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace App\Http\Livewire\Notifications;
|
||||
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\Team;
|
||||
use App\Notifications\TestNotification;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Component;
|
||||
|
||||
class EmailSettings extends Component
|
||||
@@ -33,6 +36,22 @@ class EmailSettings extends Component
|
||||
'model.extra_attributes.smtp_password' => '',
|
||||
'model.extra_attributes.smtp_test_recipients' => '',
|
||||
];
|
||||
public function copySMTP()
|
||||
{
|
||||
$settings = InstanceSettings::get();
|
||||
$this->model->extra_attributes->smtp_active = true;
|
||||
$this->model->extra_attributes->smtp_from_address = $settings->extra_attributes->smtp_from_address;
|
||||
$this->model->extra_attributes->smtp_from_name = $settings->extra_attributes->smtp_from_name;
|
||||
$this->model->extra_attributes->smtp_recipients = $settings->extra_attributes->smtp_recipients;
|
||||
$this->model->extra_attributes->smtp_host = $settings->extra_attributes->smtp_host;
|
||||
$this->model->extra_attributes->smtp_port = $settings->extra_attributes->smtp_port;
|
||||
$this->model->extra_attributes->smtp_encryption = $settings->extra_attributes->smtp_encryption;
|
||||
$this->model->extra_attributes->smtp_username = $settings->extra_attributes->smtp_username;
|
||||
$this->model->extra_attributes->smtp_password = $settings->extra_attributes->smtp_password;
|
||||
$this->model->extra_attributes->smtp_timeout = $settings->extra_attributes->smtp_timeout;
|
||||
$this->model->extra_attributes->smtp_test_recipients = $settings->extra_attributes->smtp_test_recipients;
|
||||
$this->saveModel();
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
$this->resetErrorBag();
|
||||
@@ -48,6 +67,10 @@ class EmailSettings extends Component
|
||||
session(['currentTeam' => $this->model]);
|
||||
}
|
||||
}
|
||||
public function sendTestNotification()
|
||||
{
|
||||
Notification::send($this->model, new TestNotification);
|
||||
}
|
||||
public function instantSave()
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Notifications;
|
||||
|
||||
use App\Models\Server;
|
||||
use App\Models\Team;
|
||||
use App\Notifications\TestNotification;
|
||||
use Livewire\Component;
|
||||
use Notification;
|
||||
|
||||
class Test extends Component
|
||||
{
|
||||
public Team $model;
|
||||
public function sendTestNotification()
|
||||
{
|
||||
Notification::send($this->model, new TestNotification);
|
||||
$this->emit('saved', 'Test notification sent.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user