Show contact confirmation before sending email

This commit is contained in:
Mark Gregory
2026-11-19 19:37:41 +00:00
parent 26e1acf066
commit ce5b93c3b9
2 changed files with 20 additions and 2 deletions
+3 -1
View File
@@ -6,6 +6,8 @@ use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;
use Livewire\Component;
use Throwable;
use function Illuminate\Support\defer;
class ContactForm extends Component {
public string $name = '';
public string $email = '';
@@ -23,7 +25,7 @@ class ContactForm extends Component {
$this->reset(['name','email','company','service','message']);
$this->submitted = true;
$this->notifyByEmail($enquiry);
defer(fn () => $this->notifyByEmail($enquiry))->always();
}
/** Send a notification and record failures without including enquiry contents. */