Mute notifications for demo site.

This commit is contained in:
Sander Dorigo
2025-04-01 06:59:55 +02:00
parent e34e53eeb3
commit 093a6387a2
5 changed files with 31 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Notifications\Test;
use FireflyIII\Notifications\Notifiables\OwnerNotifiable;
use FireflyIII\Support\Facades\FireflyConfig;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
@@ -63,6 +64,10 @@ class OwnerTestNotificationEmail extends Notification
*/
public function via(OwnerNotifiable $notifiable): array
{
$isDemoSite = FireflyConfig::get('is_demo_site');
if(true === $isDemoSite) {
return [];
}
return ['mail'];
}
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Notifications\Test;
use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
@@ -60,6 +61,10 @@ class UserTestNotificationEmail extends Notification
*/
public function via(User $notifiable): array
{
$isDemoSite = FireflyConfig::get('is_demo_site');
if(true === $isDemoSite) {
return [];
}
return ['mail'];
}
}