From b296d6a07eb54c6851c4414867046e511da636d0 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Sat, 21 Mar 2026 12:59:22 +0000 Subject: [PATCH] Change lead notification email from support to sales Update the lead submission form to send new lead notifications to sales@nativephp.com instead of support@nativephp.com, and add a test assertion to verify the correct recipient. Co-Authored-By: Claude Opus 4.6 --- app/Livewire/LeadSubmissionForm.php | 2 +- tests/Feature/LeadSubmissionTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Livewire/LeadSubmissionForm.php b/app/Livewire/LeadSubmissionForm.php index a723c226..dfd391a2 100644 --- a/app/Livewire/LeadSubmissionForm.php +++ b/app/Livewire/LeadSubmissionForm.php @@ -79,7 +79,7 @@ public function submit(): void $lead->notify(new LeadReceived); - Notification::route('mail', 'support@nativephp.com') + Notification::route('mail', 'sales@nativephp.com') ->notify(new NewLeadSubmitted($lead)); $this->submitted = true; diff --git a/tests/Feature/LeadSubmissionTest.php b/tests/Feature/LeadSubmissionTest.php index f8650872..96989f1f 100644 --- a/tests/Feature/LeadSubmissionTest.php +++ b/tests/Feature/LeadSubmissionTest.php @@ -5,6 +5,7 @@ use App\Livewire\LeadSubmissionForm; use App\Models\Lead; use App\Notifications\LeadReceived; +use App\Notifications\NewLeadSubmitted; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Notification; @@ -60,6 +61,13 @@ public function lead_can_be_submitted_successfully(): void Lead::first(), LeadReceived::class ); + + Notification::assertSentOnDemand( + NewLeadSubmitted::class, + function ($notification, $channels, $notifiable) { + return $notifiable->routes['mail'] === 'sales@nativephp.com'; + } + ); } #[Test]