diff --git a/app/Notifications/NewPluginAvailable.php b/app/Notifications/NewPluginAvailable.php index a87c4809..ea8cf415 100644 --- a/app/Notifications/NewPluginAvailable.php +++ b/app/Notifications/NewPluginAvailable.php @@ -35,7 +35,7 @@ public function toMail(object $notifiable): MailMessage ->greeting('A new plugin is available!') ->line("**{$this->plugin->name}** has just been added to the NativePHP Plugin Marketplace.") ->action('View Plugin', route('plugins.show', $this->plugin->routeParams())) - ->line('You can manage your notification preferences in your account settings.'); + ->line('[Manage your notification preferences]('.route('customer.settings', ['tab' => 'notifications']).').'); } /** diff --git a/package-lock.json b/package-lock.json index 5da89bcd..586eb241 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "zappy-ox", + "name": "lazy-eagle", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/tests/Feature/Notifications/NewPluginAvailableTest.php b/tests/Feature/Notifications/NewPluginAvailableTest.php index d6eb1b3c..7581a0f2 100644 --- a/tests/Feature/Notifications/NewPluginAvailableTest.php +++ b/tests/Feature/Notifications/NewPluginAvailableTest.php @@ -115,6 +115,22 @@ public function test_database_notification_contains_plugin_data(): void $this->assertEquals('View Plugin', $data['action_label']); } + public function test_mail_contains_notification_preferences_link(): void + { + $user = User::factory()->create(); + $plugin = Plugin::factory()->for($user)->create(); + + $notification = new NewPluginAvailable($plugin); + $mail = $notification->toMail($user); + + $expectedUrl = route('customer.settings', ['tab' => 'notifications']); + $found = collect($mail->introLines)->concat($mail->outroLines)->contains(function ($line) use ($expectedUrl) { + return str_contains($line, $expectedUrl); + }); + + $this->assertTrue($found, 'Mail should contain a link to the notification preferences page.'); + } + public function test_new_users_receive_new_plugin_notifications_by_default(): void { $user = User::factory()->create();