Converted all notification emails to the branded layout by routing them through a shared Blade template and swapping
the MailMessage builders to use view(). This keeps the existing copy/labels but aligns the look with resources/views/ emails/partials/layout.blade.php. I also switched the customer add‑on receipt notification to reuse the existing branded view and added missing translations for the upload pipeline alert.
This commit is contained in:
44
tests/Feature/VerifyEmailNotificationTest.php
Normal file
44
tests/Feature/VerifyEmailNotificationTest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Notifications\VerifyEmailNotification;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Tests\TestCase;
|
||||
|
||||
class VerifyEmailNotificationTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_user_sends_custom_verify_email_notification(): void
|
||||
{
|
||||
Notification::fake();
|
||||
|
||||
$user = User::factory()->create([
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
|
||||
$user->sendEmailVerificationNotification();
|
||||
|
||||
Notification::assertSentTo($user, VerifyEmailNotification::class);
|
||||
}
|
||||
|
||||
public function test_verify_email_notification_uses_custom_view(): void
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
|
||||
$notification = new VerifyEmailNotification;
|
||||
$mailMessage = $notification->toMail($user);
|
||||
|
||||
$this->assertInstanceOf(MailMessage::class, $mailMessage);
|
||||
$this->assertSame('emails.verify-email', $mailMessage->view);
|
||||
$this->assertArrayHasKey('verificationUrl', $mailMessage->viewData);
|
||||
$this->assertArrayHasKey('user', $mailMessage->viewData);
|
||||
$this->assertSame($user->getKey(), $mailMessage->viewData['user']->getKey());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user