mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
fix: notifications
This commit is contained in:
@@ -97,6 +97,10 @@ class TestNotification extends Notification
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail', 'slack'];
|
||||
$slackUrl = (string)app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
if (str_starts_with($slackUrl, 'https://hooks.slack.com/services/')) {
|
||||
return ['mail', 'slack'];
|
||||
}
|
||||
return ['mail'];
|
||||
}
|
||||
}
|
||||
|
@@ -100,6 +100,10 @@ class UserInvitation extends Notification
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail', 'slack'];
|
||||
$slackUrl = (string)app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
if (str_starts_with($slackUrl, 'https://hooks.slack.com/services/')) {
|
||||
return ['mail', 'slack'];
|
||||
}
|
||||
return ['mail'];
|
||||
}
|
||||
}
|
||||
|
@@ -98,6 +98,10 @@ class UserRegistration extends Notification
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail', 'slack'];
|
||||
$slackUrl = (string)app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
if (str_starts_with($slackUrl, 'https://hooks.slack.com/services/')) {
|
||||
return ['mail', 'slack'];
|
||||
}
|
||||
return ['mail'];
|
||||
}
|
||||
}
|
||||
|
@@ -87,14 +87,14 @@ 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');
|
||||
//// });
|
||||
// ->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)
|
||||
@@ -112,6 +112,10 @@ class VersionCheckResult extends Notification
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['mail', 'slack'];
|
||||
$slackUrl = (string)app('preferences')->getForUser(auth()->user(), 'slack_webhook_url', '')->data;
|
||||
if (str_starts_with($slackUrl, 'https://hooks.slack.com/services/')) {
|
||||
return ['mail', 'slack'];
|
||||
}
|
||||
return ['mail'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user