Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix send test email

peaklabs-dev19ce01f7d864
diff --git a/app/Livewire/Notifications/Email.php b/app/Livewire/Notifications/Email.php
index 56f07f3a91..94b5e17c2f 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 @@ class Email extends Component
}
}
- 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 a2e5326c69..182c73d6a5 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))
<x-modal-input buttonTitle="Send Test Email" title="Send Test Email">
- <form wire:submit='submit' class="flex flex-col w-full gap-2">
- <x-forms.input placeholder="[email protected]" id="emails" label="Recipients" required />
- <x-forms.button wire:click="sendTestNotification" @click="modalOpen=false">
+ <form wire:submit.prevent="sendTestEmail" class="flex flex-col w-full gap-2">
+ <x-forms.input wire:model="testEmailAddress" placeholder="[email protected]" id="testEmailAddress" label="Recipients" required />
+ <x-forms.button type="submit" @click="modalOpen=false">
Send Email
</x-forms.button>
</form>