mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Webhooks: Fix invoice interpolation (#5586)
* Webhooks: Fix invoice interpolation Fixes #5584. * Syntax cleanups
This commit is contained in:
parent
ad89139e07
commit
c585a0b276
4 changed files with 7 additions and 12 deletions
|
@ -59,15 +59,12 @@ public class StoreEmailRuleProcessorSender : EventHostedServiceBase
|
||||||
var sender = await _emailSenderFactory.GetEmailSender(storeWebhookEvent.StoreId);
|
var sender = await _emailSenderFactory.GetEmailSender(storeWebhookEvent.StoreId);
|
||||||
foreach (UIStoresController.StoreEmailRule actionableRule in actionableRules)
|
foreach (UIStoresController.StoreEmailRule actionableRule in actionableRules)
|
||||||
{
|
{
|
||||||
|
var request = new SendEmailRequest
|
||||||
|
|
||||||
var request = new SendEmailRequest()
|
|
||||||
{
|
{
|
||||||
Subject = actionableRule.Subject, Body = actionableRule.Body, Email = actionableRule.To
|
Subject = actionableRule.Subject, Body = actionableRule.Body, Email = actionableRule.To
|
||||||
};
|
};
|
||||||
request = await webhookDeliveryRequest.Interpolate(request, actionableRule);
|
request = await webhookDeliveryRequest.Interpolate(request, actionableRule);
|
||||||
|
|
||||||
|
|
||||||
var recipients = (request?.Email?.Split(",", StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>())
|
var recipients = (request?.Email?.Split(",", StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>())
|
||||||
.Select(o =>
|
.Select(o =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
using System;
|
using System.Globalization;
|
||||||
using System.Globalization;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BTCPayServer.Client.Models;
|
using BTCPayServer.Client.Models;
|
||||||
using BTCPayServer.Controllers;
|
using BTCPayServer.Controllers;
|
||||||
using BTCPayServer.Data;
|
using BTCPayServer.Data;
|
||||||
using BTCPayServer.Services.Invoices;
|
using BTCPayServer.Services.Invoices;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using WebhookDeliveryData = BTCPayServer.Data.WebhookDeliveryData;
|
using WebhookDeliveryData = BTCPayServer.Data.WebhookDeliveryData;
|
||||||
|
|
||||||
namespace BTCPayServer.HostedServices.Webhooks;
|
namespace BTCPayServer.HostedServices.Webhooks;
|
||||||
|
@ -46,7 +44,7 @@ public class InvoiceWebhookDeliveryRequest : WebhookSender.WebhookDeliveryReques
|
||||||
.Replace("{Invoice.OrderId}", Invoice.Metadata.OrderId);
|
.Replace("{Invoice.OrderId}", Invoice.Metadata.OrderId);
|
||||||
|
|
||||||
|
|
||||||
res = InterpolateJsonField(str, "Invoice.Metadata", Invoice.Metadata.ToJObject());
|
res = InterpolateJsonField(res, "Invoice.Metadata", Invoice.Metadata.ToJObject());
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue