mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Allow disabling notifications per user and disabling specific notifications per user (#1991)
* Allow disabling notifications per user and disabling specific notifications per use closes #1974 * Add disable notifs for all users * fix term generator for notifications * sow checkboxes instead of multiselect when js is enabled * remove js dependency * fix notif conditions
This commit is contained in:
@@ -9,8 +9,9 @@ using Microsoft.AspNetCore.Routing;
|
||||
|
||||
namespace BTCPayServer.Services.Notifications.Blobs
|
||||
{
|
||||
internal class InvoiceEventNotification
|
||||
internal class InvoiceEventNotification:BaseNotification
|
||||
{
|
||||
private const string TYPE = "invoicestate";
|
||||
internal class Handler : NotificationHandler<InvoiceEventNotification>
|
||||
{
|
||||
private readonly LinkGenerator _linkGenerator;
|
||||
@@ -22,7 +23,16 @@ namespace BTCPayServer.Services.Notifications.Blobs
|
||||
_options = options;
|
||||
}
|
||||
|
||||
public override string NotificationType => "invoicestate";
|
||||
public override string NotificationType => TYPE;
|
||||
|
||||
public override (string identifier, string name)[] Meta
|
||||
{
|
||||
get
|
||||
{
|
||||
return new (string identifier, string name)[] {(TYPE, "All invoice updates"),}
|
||||
.Concat(TextMapping.Select(pair => ($"{TYPE}_{pair.Key}", $"Invoice {pair.Value}"))).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
internal static Dictionary<string, string> TextMapping = new Dictionary<string, string>()
|
||||
{
|
||||
@@ -65,5 +75,7 @@ namespace BTCPayServer.Services.Notifications.Blobs
|
||||
|
||||
public string InvoiceId { get; set; }
|
||||
public string Event { get; set; }
|
||||
public override string Identifier => $"{TYPE}_{Event}";
|
||||
public override string NotificationType => TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user