From ecead8a27bff4a6c112bdb188610ec07143bd70e Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 17 Jul 2023 20:15:47 +0200 Subject: [PATCH] Another attempt to fix Slack --- app/Notifications/Admin/TestNotification.php | 2 +- app/Notifications/Admin/UserInvitation.php | 2 +- app/Notifications/Admin/UserRegistration.php | 2 +- app/Notifications/Admin/VersionCheckResult.php | 13 ++++++++++++- app/Notifications/User/BillReminder.php | 2 +- app/Notifications/User/NewAccessToken.php | 2 +- app/Notifications/User/UserLogin.php | 2 +- 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/Notifications/Admin/TestNotification.php b/app/Notifications/Admin/TestNotification.php index 056ac15ad7..79877f08a2 100644 --- a/app/Notifications/Admin/TestNotification.php +++ b/app/Notifications/Admin/TestNotification.php @@ -26,7 +26,7 @@ namespace FireflyIII\Notifications\Admin; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; /** diff --git a/app/Notifications/Admin/UserInvitation.php b/app/Notifications/Admin/UserInvitation.php index 1927da7278..6e4ebb071f 100644 --- a/app/Notifications/Admin/UserInvitation.php +++ b/app/Notifications/Admin/UserInvitation.php @@ -27,7 +27,7 @@ namespace FireflyIII\Notifications\Admin; use FireflyIII\Models\InvitedUser; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; /** diff --git a/app/Notifications/Admin/UserRegistration.php b/app/Notifications/Admin/UserRegistration.php index 1a3f234279..b57b4f5cec 100644 --- a/app/Notifications/Admin/UserRegistration.php +++ b/app/Notifications/Admin/UserRegistration.php @@ -27,7 +27,7 @@ namespace FireflyIII\Notifications\Admin; use FireflyIII\User; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; /** diff --git a/app/Notifications/Admin/VersionCheckResult.php b/app/Notifications/Admin/VersionCheckResult.php index 60ee23f425..c0d97abdb8 100644 --- a/app/Notifications/Admin/VersionCheckResult.php +++ b/app/Notifications/Admin/VersionCheckResult.php @@ -26,7 +26,7 @@ namespace FireflyIII\Notifications\Admin; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; /** @@ -86,6 +86,17 @@ class VersionCheckResult extends Notification */ public function toSlack($notifiable) { + // return (new SlackMessage())->text($this->message) +// ->sectionBlock(function (SectionBlock $block) { +// $button = new ButtonElement('Button'); +// $button->url('https://github.com/firefly-iii/firefly-iii/releases'); +// $block->accessory($button); +// }); +//// ->attachment(function ($attachment) { +//// $attachment->title('Firefly III @ GitHub', 'https://github.com/firefly-iii/firefly-iii/releases'); +//// }); + + return (new SlackMessage())->content($this->message) ->attachment(function ($attachment) { $attachment->title('Firefly III @ GitHub', 'https://github.com/firefly-iii/firefly-iii/releases'); diff --git a/app/Notifications/User/BillReminder.php b/app/Notifications/User/BillReminder.php index 24a180b502..7f756aa819 100644 --- a/app/Notifications/User/BillReminder.php +++ b/app/Notifications/User/BillReminder.php @@ -27,7 +27,7 @@ namespace FireflyIII\Notifications\User; use FireflyIII\Models\Bill; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; /** diff --git a/app/Notifications/User/NewAccessToken.php b/app/Notifications/User/NewAccessToken.php index 3794a3f607..e57c719047 100644 --- a/app/Notifications/User/NewAccessToken.php +++ b/app/Notifications/User/NewAccessToken.php @@ -26,7 +26,7 @@ namespace FireflyIII\Notifications\User; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; /** diff --git a/app/Notifications/User/UserLogin.php b/app/Notifications/User/UserLogin.php index 5e3e649631..c4ff10025a 100644 --- a/app/Notifications/User/UserLogin.php +++ b/app/Notifications/User/UserLogin.php @@ -29,7 +29,7 @@ use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Log; -use Illuminate\Notifications\Slack\SlackMessage; +use Illuminate\Notifications\Messages\SlackMessage; /** * Class UserLogin