Fix: Allow test emails to be sent to any email address
Test emails should work with any recipient email address for verification purposes, not just team members. Added an isTestNotification flag to both Test notification classes and modified EmailChannel to skip team membership validation for test notifications. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
366ff95893
commit
546256b22c
3 changed files with 24 additions and 15 deletions
|
|
@ -43,6 +43,10 @@ public function send(SendsEmail $notifiable, Notification $notification): void
|
|||
throw new Exception('No email recipients found');
|
||||
}
|
||||
|
||||
// Skip team membership validation for test notifications
|
||||
$isTestNotification = data_get($notification, 'isTestNotification', false);
|
||||
|
||||
if (! $isTestNotification) {
|
||||
foreach ($recipients as $recipient) {
|
||||
// Check if the recipient is part of the team
|
||||
if (! $members->contains('email', $recipient)) {
|
||||
|
|
@ -60,6 +64,7 @@ public function send(SendsEmail $notifiable, Notification $notification): void
|
|||
throw new Exception('Recipient is not part of the team');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mailMessage = $notification->toMail($notifiable);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ class Test extends Notification implements ShouldQueue
|
|||
|
||||
public $tries = 5;
|
||||
|
||||
public bool $isTestNotification = true;
|
||||
|
||||
public function __construct(public ?string $emails = null, public ?string $channel = null, public ?bool $ping = false)
|
||||
{
|
||||
$this->onQueue('high');
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
class Test extends CustomEmailNotification
|
||||
{
|
||||
public bool $isTestNotification = true;
|
||||
|
||||
public function __construct(public string $emails, public bool $isTransactionalEmail = true)
|
||||
{
|
||||
$this->onQueue('high');
|
||||
|
|
|
|||
Loading…
Reference in a new issue