Skip to content

Conversation

@iloveagent57
Copy link
Member

We only want to send a receipt email when the invoice.paid total is > 0.

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

Copilot AI review requested due to automatic review settings January 9, 2026 16:26
@iloveagent57 iloveagent57 requested review from a team as code owners January 9, 2026 16:26
@iloveagent57 iloveagent57 enabled auto-merge (rebase) January 9, 2026 16:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR conditionally sends receipt emails only when the invoice.paid total is greater than zero, preventing emails from being sent during free trial periods.

Key changes:

  • Added conditional logic to check invoice.total > 0 before sending payment receipt emails
  • Enhanced test coverage to verify email sending behavior for both zero and non-zero invoice totals
  • Updated test helper to default invoice total to 0 for invoice.paid events

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
enterprise_access/apps/customer_billing/stripe_event_handlers.py Added conditional check to only send receipt emails when invoice total > 0
enterprise_access/apps/customer_billing/tests/test_stripe_event_handlers.py Added test case for non-zero invoice total, updated test helper to default total to 0, and added assertions to verify email sending behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iloveagent57 iloveagent57 force-pushed the aed/receipt-on-actual-payment branch from 8c4da39 to 2bb8dc5 Compare January 9, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants