diff --git a/BTCPayServer/Controllers/NotificationsController.cs b/BTCPayServer/Controllers/NotificationsController.cs index b8c01f687..8b9c40c17 100644 --- a/BTCPayServer/Controllers/NotificationsController.cs +++ b/BTCPayServer/Controllers/NotificationsController.cs @@ -87,7 +87,18 @@ namespace BTCPayServer.Controllers return new EmptyResult(); } +#if DEBUG + [HttpGet] + public async Task GenerateJunk(int x = 100) + { + for (int i = 0; i < x; i++) + { + await _notificationSender.SendNotification(new AdminScope(), new JunkNotification()); + } + return RedirectToAction("Index"); + } +#endif [HttpGet] public IActionResult Index(int skip = 0, int count = 50, int timezoneOffset = 0) { diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs index 1cadb52b0..04fb29eeb 100644 --- a/BTCPayServer/Hosting/BTCPayServerServices.cs +++ b/BTCPayServer/Hosting/BTCPayServerServices.cs @@ -246,7 +246,10 @@ namespace BTCPayServer.Hosting services.AddSingleton(); services.AddSingleton(); - + +#if DEBUG + services.AddSingleton(); +#endif services.TryAddSingleton(); services.TryAddSingleton(o => { diff --git a/BTCPayServer/Services/Notifications/Blobs/JunkNotification.cs b/BTCPayServer/Services/Notifications/Blobs/JunkNotification.cs new file mode 100644 index 000000000..eeecb3df4 --- /dev/null +++ b/BTCPayServer/Services/Notifications/Blobs/JunkNotification.cs @@ -0,0 +1,19 @@ +#if DEBUG +using BTCPayServer.Models.NotificationViewModels; + +namespace BTCPayServer.Services.Notifications.Blobs +{ + internal class JunkNotification + { + internal class Handler : NotificationHandler + { + public override string NotificationType => "junk"; + + protected override void FillViewModel(JunkNotification notification, NotificationViewModel vm) + { + vm.Body = $"All your junk r belong to us!"; + } + } + } +} +#endif