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]