coolify/app/Notifications/TransactionalEmails/Test.php
Andras Bacsai 546256b22c 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>
2025-12-12 11:12:19 +01:00

31 lines
712 B
PHP

<?php
namespace App\Notifications\TransactionalEmails;
use App\Notifications\Channels\EmailChannel;
use App\Notifications\CustomEmailNotification;
use Illuminate\Notifications\Messages\MailMessage;
class Test extends CustomEmailNotification
{
public bool $isTestNotification = true;
public function __construct(public string $emails, public bool $isTransactionalEmail = true)
{
$this->onQueue('high');
}
public function via(): array
{
return [EmailChannel::class];
}
public function toMail(): MailMessage
{
$mail = new MailMessage;
$mail->subject('Coolify: Test Email');
$mail->view('emails.test');
return $mail;
}
}