From aef5cc50d533e9e1a760e52c27973ce733098fc1 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 15 Jun 2020 17:18:45 +0900 Subject: [PATCH] Add the StoreScope --- .../Services/Notifications/NotificationSender.cs | 10 +++++++++- BTCPayServer/Views/Account/Login.cshtml | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Services/Notifications/NotificationSender.cs b/BTCPayServer/Services/Notifications/NotificationSender.cs index 35f616ea2..88921df7e 100644 --- a/BTCPayServer/Services/Notifications/NotificationSender.cs +++ b/BTCPayServer/Services/Notifications/NotificationSender.cs @@ -35,7 +35,7 @@ namespace BTCPayServer.Services.Notifications { foreach (var uid in users) { - var obj = JsonConvert.SerializeObject(this); + var obj = JsonConvert.SerializeObject(notification); var data = new NotificationData { Id = Guid.NewGuid().ToString(), @@ -67,6 +67,14 @@ namespace BTCPayServer.Services.Notifications var admins = await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin); return admins.Select(a => a.Id).ToArray(); } + if (scope is StoreScope s) + { + using var ctx = _contextFactory.CreateContext(); + return ctx.UserStore + .Where(u => u.StoreDataId == s.StoreId) + .Select(u => u.ApplicationUserId) + .ToArray(); + } throw new NotSupportedException("Notification scope not supported"); } } diff --git a/BTCPayServer/Views/Account/Login.cshtml b/BTCPayServer/Views/Account/Login.cshtml index b899dc9b7..b7eaadeca 100644 --- a/BTCPayServer/Views/Account/Login.cshtml +++ b/BTCPayServer/Views/Account/Login.cshtml @@ -2,6 +2,7 @@ @inject BTCPayServer.HostedServices.CssThemeManager themeManager @{ ViewData["Title"] = "Log in"; + Layout = "_LayoutWelcome"; } @if (TempData.HasStatusMessage()) {