Skip to content

Commit a4aceea

Browse files
simonhampclaude
andauthored
Change lead notification email from support to sales (#292)
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 <noreply@anthropic.com>
1 parent 87f7a5a commit a4aceea

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

app/Livewire/LeadSubmissionForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function submit(): void
7979

8080
$lead->notify(new LeadReceived);
8181

82-
Notification::route('mail', 'support@nativephp.com')
82+
Notification::route('mail', 'sales@nativephp.com')
8383
->notify(new NewLeadSubmitted($lead));
8484

8585
$this->submitted = true;

tests/Feature/LeadSubmissionTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Livewire\LeadSubmissionForm;
66
use App\Models\Lead;
77
use App\Notifications\LeadReceived;
8+
use App\Notifications\NewLeadSubmitted;
89
use Illuminate\Foundation\Testing\RefreshDatabase;
910
use Illuminate\Support\Facades\Http;
1011
use Illuminate\Support\Facades\Notification;
@@ -60,6 +61,13 @@ public function lead_can_be_submitted_successfully(): void
6061
Lead::first(),
6162
LeadReceived::class
6263
);
64+
65+
Notification::assertSentOnDemand(
66+
NewLeadSubmitted::class,
67+
function ($notification, $channels, $notifiable) {
68+
return $notifiable->routes['mail'] === 'sales@nativephp.com';
69+
}
70+
);
6371
}
6472

6573
#[Test]

0 commit comments

Comments
 (0)