This commit is contained in:
Andras Bacsai
2023-07-28 10:55:26 +02:00
parent e9bd1f88c0
commit 7e4b1a8f8f
30 changed files with 198 additions and 95 deletions

View File

@@ -3,14 +3,14 @@
namespace App\Http\Livewire\Settings;
use App\Models\InstanceSettings;
use App\Notifications\TransactionalEmails\TestEmail;
use App\Notifications\TransactionalEmails\Test;
use Illuminate\Support\Facades\Notification;
use Livewire\Component;
class Email extends Component
{
public InstanceSettings $settings;
public string $emails;
protected $rules = [
'settings.smtp_enabled' => 'nullable|boolean',
'settings.smtp_host' => 'required',
@@ -35,6 +35,7 @@ class Email extends Component
public function mount()
{
$this->decrypt();
$this->emails = auth()->user()->email;
}
public function instantSave()
{
@@ -46,9 +47,9 @@ class Email extends Component
$this->validate();
}
}
public function testNotification()
public function sendTestNotification()
{
$this->settings->notify(new TestEmail);
$this->settings->notify(new Test($this->emails));
$this->emit('success', 'Test email sent.');
}
private function decrypt()