From 94c6b65cd2e299aa459c223904a152d8c0eb4694 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Fri, 3 Oct 2025 17:51:43 -0400 Subject: [PATCH] Fix localhost domain issue in economically unviable refund emails Updated economically unviable refund email notifications to use create_shop_context_request() instead of passing env_request directly or creating DummyRequest objects. This ensures emails are sent from the proper shop domain instead of localhost. Fixed in: - Expired payment processing (line ~2147) - Underpayment processing (line ~2911) - Passive monitoring refund retries (line ~3290) Note: Duplicate payment processing was already correct. --- make_post_sell/lib/crypto_watcher/__init__.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/make_post_sell/lib/crypto_watcher/__init__.py b/make_post_sell/lib/crypto_watcher/__init__.py index dae0326..3ee7506 100644 --- a/make_post_sell/lib/crypto_watcher/__init__.py +++ b/make_post_sell/lib/crypto_watcher/__init__.py @@ -2144,8 +2144,12 @@ def process_payment( # Send refund email notification if crypto_payment.invoice and crypto_payment.invoice.user: try: + # Create shop context request + email_request = create_shop_context_request( + env_request, crypto_payment + ) send_refund_email( - env_request, + email_request, crypto_payment.invoice.user.email, crypto_payment, refund_details, @@ -2904,8 +2908,12 @@ def process_payment( # Send refund email notification if crypto_payment.invoice and crypto_payment.invoice.user: try: + # Create shop context request + email_request = create_shop_context_request( + env_request, crypto_payment + ) send_refund_email( - env_request, + email_request, crypto_payment.invoice.user.email, crypto_payment, refund_details, @@ -3279,10 +3287,10 @@ def process_refund_confirmations(request, settings): # Send refund email notification if payment.invoice and payment.invoice.user: try: - # Create a basic request object for email context - from pyramid.testing import DummyRequest - email_request = DummyRequest() - email_request.registry = request.registry + # Create shop context request + email_request = create_shop_context_request( + request, payment + ) send_refund_email( email_request, payment.invoice.user.email,