Skip to content

Conversation

@iloveagent57
Copy link
Member

  1. Only send a trial cancelation email if the sub to be cancelled is in a trialing status.
  2. Use the cancel_at timestamp in the notification, instead of the trail_end time, because the user may want to cancel sooner than trial end.

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 15, 2026 15:57
@iloveagent57 iloveagent57 requested review from a team as code owners January 15, 2026 15:57
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 fixes the trial cancellation notification logic to use the cancel_at timestamp instead of trial_end, and ensures the cancellation email is only sent when the subscription is in a trialing status.

Changes:

  • Updated the condition to check subscription status is TRIALING instead of checking for trial_end existence
  • Renamed the parameter from trial_end_timestamp to cancel_at_timestamp throughout the codebase
  • Updated documentation to reflect the new parameter name and its meaning

Reviewed changes

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

File Description
enterprise_access/apps/customer_billing/stripe_event_handlers.py Changed cancellation email trigger condition and updated parameter name
enterprise_access/apps/customer_billing/tasks.py Renamed function parameter and updated documentation
enterprise_access/apps/customer_billing/tests/test_tasks.py Updated test setup and test calls to use new parameter name
enterprise_access/apps/customer_billing/tests/test_stripe_event_handlers.py Updated test assertion to use new parameter name
Comments suppressed due to low confidence (2)

enterprise_access/apps/customer_billing/tasks.py:214

  • The docstring states the email includes 'the (future) trial end date' but the code now uses cancel_at_timestamp which may be different from the trial end date. The documentation should be updated to reflect that the email includes the cancellation date, not necessarily the trial end date.
    admins. The email includes the (future) trial end date and a link to

enterprise_access/apps/customer_billing/tasks.py:258

  • The Braze trigger property is named 'trial_end_date' but now contains the cancel_at timestamp, which may be different from the trial end date. Consider renaming this property to 'cancellation_date' or 'cancel_at_date' for clarity, or verify that the Braze email template expects this specific key name.
        "trial_end_date": ending_date,

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

@iloveagent57 iloveagent57 merged commit c76fc63 into main Jan 15, 2026
9 checks passed
@iloveagent57 iloveagent57 deleted the aed/correct-cancel-at-time branch January 15, 2026 17:13
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.

3 participants