fix send test email

This commit is contained in:
peaklabs-dev
2024-11-21 15:48:47 +01:00
parent 131a3920f0
commit 19ce01f7d8
2 changed files with 8 additions and 5 deletions

View File

@@ -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,