From 2778e55005c6cf1bdd13868906ff4bb2cce6471d Mon Sep 17 00:00:00 2001 From: sveng93 Date: Fri, 28 Nov 2025 10:29:24 +0100 Subject: [PATCH 1/4] Fix mail on completed test --- app/Listeners/ProcessCompletedSpeedtest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Listeners/ProcessCompletedSpeedtest.php b/app/Listeners/ProcessCompletedSpeedtest.php index 94c2caa89..b67366cfe 100644 --- a/app/Listeners/ProcessCompletedSpeedtest.php +++ b/app/Listeners/ProcessCompletedSpeedtest.php @@ -104,7 +104,7 @@ private function notifyDispatchingUser(Result $result): void */ private function notifyMailChannels(Result $result): void { - if (empty($result->dispatched_by) || ! $result->healthy) { + if (filled($result->dispatched_by) || ! $result->healthy) { return; } From 9c71f49c8a79c2cd56a55ce07c1a8d1efcd9b80e Mon Sep 17 00:00:00 2001 From: sveng93 Date: Fri, 28 Nov 2025 12:02:41 +0100 Subject: [PATCH 2/4] improve webhook and notification info --- app/Filament/Pages/Settings/Notification.php | 21 +++++++++++++++++++- lang/en/settings/notifications.php | 3 +++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/Filament/Pages/Settings/Notification.php b/app/Filament/Pages/Settings/Notification.php index 3fd0d82c5..a7d7cd450 100755 --- a/app/Filament/Pages/Settings/Notification.php +++ b/app/Filament/Pages/Settings/Notification.php @@ -65,6 +65,11 @@ public function form(Schema $schema): Schema { return $schema ->components([ + SimpleAlert::make('manual_tests_info') + ->description(__('settings/notifications.manual_tests_info')) + ->border() + ->info() + ->columnSpanFull(), Tabs::make() ->schema([ Tab::make(__('settings/notifications.database')) @@ -147,12 +152,26 @@ public function form(Schema $schema): Schema Toggle::make('webhook_enabled') ->label(__('general.enable')) ->live(), - Grid::make([ 'default' => 1, ]) ->hidden(fn (Get $get) => $get('webhook_enabled') !== true) ->schema([ + SimpleAlert::make('wehbook_info') + ->title(__('settings/notifications.webhook_hint')) + ->description(__('settings/notifications.webhook_hint_description')) + ->border() + ->warning() + ->actions([ + Action::make('webhook_docs') + ->label('View documentation') + ->icon('heroicon-m-arrow-long-right') + ->link() + ->url('https://docs.speedtest-tracker.dev/settings/notifications/webhook') + ->openUrlInNewTab() + ->color('warning'), + ]) + ->columnSpanFull(), Fieldset::make(__('settings.triggers')) ->columns(1) ->schema([ diff --git a/lang/en/settings/notifications.php b/lang/en/settings/notifications.php index 6dcf09a88..05f5ceee3 100644 --- a/lang/en/settings/notifications.php +++ b/lang/en/settings/notifications.php @@ -24,6 +24,8 @@ 'webhook_on_speedtest_run' => 'Notify on every speedtest run', 'webhook_on_threshold_failure' => 'Notify on threshold failures', 'test_webhook_channel' => 'Test webhook channel', + 'webhook_hint' => 'Payload documentation', + 'webhook_hint_description' => 'These are generic webhooks. For payload examples and implementation details, view the documentation.', // Common notification messages 'notify_on_every_speedtest_run' => 'Notify on every speedtest run', @@ -50,4 +52,5 @@ // Helper text 'threshold_helper_text' => 'Threshold notifications will be sent to the /fail route in the URL.', + 'manual_tests_info' => 'Notifications are only sent for scheduled tests, not for manually triggered tests.', ]; From 16e2bd2cd64d065d7cd6d3c7ee20a86339a33f50 Mon Sep 17 00:00:00 2001 From: sveng93 Date: Fri, 28 Nov 2025 12:04:39 +0100 Subject: [PATCH 3/4] brainfart --- app/Listeners/ProcessCompletedSpeedtest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Listeners/ProcessCompletedSpeedtest.php b/app/Listeners/ProcessCompletedSpeedtest.php index b67366cfe..94c2caa89 100644 --- a/app/Listeners/ProcessCompletedSpeedtest.php +++ b/app/Listeners/ProcessCompletedSpeedtest.php @@ -104,7 +104,7 @@ private function notifyDispatchingUser(Result $result): void */ private function notifyMailChannels(Result $result): void { - if (filled($result->dispatched_by) || ! $result->healthy) { + if (empty($result->dispatched_by) || ! $result->healthy) { return; } From 3f56f1ed7c1cb9f4a60a43185d8c5a794c77fcc7 Mon Sep 17 00:00:00 2001 From: sveng93 Date: Fri, 28 Nov 2025 13:44:53 +0100 Subject: [PATCH 4/4] Remove simplealert for manual test --- app/Filament/Pages/Settings/Notification.php | 5 ----- lang/en/settings/notifications.php | 1 - 2 files changed, 6 deletions(-) diff --git a/app/Filament/Pages/Settings/Notification.php b/app/Filament/Pages/Settings/Notification.php index a7d7cd450..88e9db1c0 100755 --- a/app/Filament/Pages/Settings/Notification.php +++ b/app/Filament/Pages/Settings/Notification.php @@ -65,11 +65,6 @@ public function form(Schema $schema): Schema { return $schema ->components([ - SimpleAlert::make('manual_tests_info') - ->description(__('settings/notifications.manual_tests_info')) - ->border() - ->info() - ->columnSpanFull(), Tabs::make() ->schema([ Tab::make(__('settings/notifications.database')) diff --git a/lang/en/settings/notifications.php b/lang/en/settings/notifications.php index 05f5ceee3..2363fd034 100644 --- a/lang/en/settings/notifications.php +++ b/lang/en/settings/notifications.php @@ -52,5 +52,4 @@ // Helper text 'threshold_helper_text' => 'Threshold notifications will be sent to the /fail route in the URL.', - 'manual_tests_info' => 'Notifications are only sent for scheduled tests, not for manually triggered tests.', ];