Add "Don't notify customer" option to Record Payment modal
Adds SuppressNotification to RecordPaymentDto and a checkbox to the modal. When checked, the payment is fully recorded but NotifyPaymentReceivedAsync is skipped — useful for historical imports or cases where the customer should not receive an email. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1335,14 +1335,17 @@ public class InvoicesController : Controller
|
||||
|
||||
}); // end ExecuteInTransactionAsync
|
||||
|
||||
// Notify (non-blocking)
|
||||
try
|
||||
// Notify (non-blocking) — skipped if user explicitly suppressed it
|
||||
if (!dto.SuppressNotification)
|
||||
{
|
||||
await _notificationService.NotifyPaymentReceivedAsync(invoice, payment);
|
||||
}
|
||||
catch (Exception notifyEx)
|
||||
{
|
||||
_logger.LogWarning(notifyEx, "Payment recorded but notification failed");
|
||||
try
|
||||
{
|
||||
await _notificationService.NotifyPaymentReceivedAsync(invoice, payment);
|
||||
}
|
||||
catch (Exception notifyEx)
|
||||
{
|
||||
_logger.LogWarning(notifyEx, "Payment recorded but notification failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user