Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Notifications/NewPluginAvailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']).').');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tests/Feature/Notifications/NewPluginAvailableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading