Don't send mail for expired invoices

This commit is contained in:
Dennis Reimann
2020-08-28 16:20:59 +02:00
parent 8ba852084e
commit 1c5567225c

View File

@@ -118,7 +118,7 @@ namespace BTCPayServer.HostedServices
#pragma warning restore CS0618
}
if (!String.IsNullOrEmpty(invoice.NotificationEmail))
if (invoiceEvent.Name != InvoiceEvent.Expired && !String.IsNullOrEmpty(invoice.NotificationEmail))
{
var emailBody = NBitcoin.JsonConverters.Serializer.ToString(notification);
@@ -126,7 +126,6 @@ namespace BTCPayServer.HostedServices
invoice.NotificationEmail,
$"BtcPayServer Invoice Notification - ${invoice.StoreId}",
emailBody);
}
if (invoice.NotificationURL != null)