From 19ce01f7d8648eb2363a204bbef2a21feb049af2 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:48:47 +0100 Subject: [PATCH] fix send test email --- app/Livewire/Notifications/Email.php | 7 +++++-- resources/views/livewire/notifications/email.blade.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Livewire/Notifications/Email.php b/app/Livewire/Notifications/Email.php index 56f07f3a9..94b5e17c2 100644 --- a/app/Livewire/Notifications/Email.php +++ b/app/Livewire/Notifications/Email.php @@ -73,6 +73,9 @@ class Email extends Component #[Validate(['nullable', 'string'])] public ?string $resendApiKey = null; + #[Validate(['required', 'email'])] + public string $testEmailAddress = ''; + public function mount() { try { @@ -132,14 +135,14 @@ public function syncData(bool $toModel = false) } } - public function sendTestNotification() + public function sendTestEmail() { try { $executed = RateLimiter::attempt( 'test-email:'.$this->team->id, $perMinute = 0, function () { - $this->team?->notify(new Test($this->emails)); + $this->team?->notify(new Test($this->testEmailAddress)); $this->dispatch('success', 'Test Email sent.'); }, $decaySeconds = 10, diff --git a/resources/views/livewire/notifications/email.blade.php b/resources/views/livewire/notifications/email.blade.php index a2e5326c6..182c73d6a 100644 --- a/resources/views/livewire/notifications/email.blade.php +++ b/resources/views/livewire/notifications/email.blade.php @@ -16,9 +16,9 @@ @endif @if (isEmailEnabled($team) && auth()->user()->isAdminFromSession() && isTestEmailEnabled($team)) -
- - + + + Send Email