diff --git a/BTCPayServer/HostedServices/Webhooks/PendingTransactionDeliveryRequest.cs b/BTCPayServer/HostedServices/Webhooks/PendingTransactionDeliveryRequest.cs index 8efbc4592..4038e4bae 100644 --- a/BTCPayServer/HostedServices/Webhooks/PendingTransactionDeliveryRequest.cs +++ b/BTCPayServer/HostedServices/Webhooks/PendingTransactionDeliveryRequest.cs @@ -36,7 +36,11 @@ public class PendingTransactionDeliveryRequest( private string Interpolate(string str, PendingTransactionBlob blob) { - var res = str.Replace("{PendingTransaction.Id}", evt.Data.TransactionId) + var id = evt.Data.TransactionId; + string trimmedId = $"{id.Substring(0, 7)}...{id.Substring(id.Length - 7)}"; + + var res = str.Replace("{PendingTransaction.Id}", id) + .Replace("{PendingTransaction.TrimmedId}", trimmedId) .Replace("{PendingTransaction.StoreId}", evt.Data.StoreId) .Replace("{PendingTransaction.SignaturesCollected}", blob.SignaturesCollected?.ToString()) .Replace("{PendingTransaction.SignaturesNeeded}", blob.SignaturesNeeded?.ToString()) diff --git a/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml b/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml index d1e3bed90..543a6d7e9 100644 --- a/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml +++ b/BTCPayServer/Views/UIStores/StoreEmailRulesManage.cshtml @@ -112,6 +112,7 @@ Pending Transaction {PendingTransaction.Id}, + {PendingTransaction.TrimmedId}, {PendingTransaction.StoreId}, {PendingTransaction.SignaturesCollected}, {PendingTransaction.SignaturesNeeded}, @@ -160,21 +161,21 @@ body: 'Invoice {Invoice.Id} (Order Id: {Invoice.OrderId}) payment settled.' }, @PendingTransactionWebhookProvider.PendingTransactionCreated : { - subject: 'Pending Transaction {PendingTransaction.Id} Created', - body: 'Review the transaction and sign it on: @hostRoot/wallets/S-{PendingTransaction.StoreId}-BTC/transactions' + subject: 'Pending Transaction {PendingTransaction.TrimmedId} Created', + body: 'Review the transaction {PendingTransaction.Id} and sign it on: @hostRoot/wallets/S-{PendingTransaction.StoreId}-BTC/transactions' }, @PendingTransactionWebhookProvider.PendingTransactionSignatureCollected : { - subject: 'Signature Collected for Pending Transaction {PendingTransaction.Id}', + subject: 'Signature Collected for Pending Transaction {PendingTransaction.TrimmedId}', body: 'So far {PendingTransaction.SignaturesCollected} signatures collected out of {PendingTransaction.SignaturesNeeded} signatures needed. ' + 'Review the transaction and sign it on: @hostRoot/wallets/S-{PendingTransaction.StoreId}-BTC/transactions' }, @PendingTransactionWebhookProvider.PendingTransactionBroadcast : { - subject: 'Transaction {PendingTransaction.Id} has been Broadcast', + subject: 'Transaction {PendingTransaction.TrimmedId} has been Broadcast', body: 'Transaction is visible in mempool on: https://mempool.space/tx/{PendingTransaction.Id}. ' + 'Review the transaction: @hostRoot/wallets/S-{PendingTransaction.StoreId}-BTC/transactions' }, @PendingTransactionWebhookProvider.PendingTransactionCancelled : { - subject: 'Pending Transaction {PendingTransaction.Id} Cancelled', + subject: 'Pending Transaction {PendingTransaction.TrimmedId} Cancelled', body: 'Transaction {PendingTransaction.Id} is cancelled and signatures are no longer being collected. ' + 'Review the wallet: @hostRoot/wallets/S-{PendingTransaction.StoreId}-BTC/transactions' },