Skip to content

chore: remove xpro-enrollment-welcome-email feature flag - #4091

Merged
arslanashraf7 merged 1 commit into
masterfrom
arslan/remove-welcome-email-flag
Sep 14, 2026
Merged

arslanashraf7 merged 1 commit into
masterfrom
arslan/remove-welcome-email-flag

Conversation

@arslanashraf7

@arslanashraf7 arslanashraf7 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/12661

Description (What does it do?)

  • Removes the ENROLLMENT_WELCOME_EMAIL PostHog feature flag (xpro-enrollment-welcome-email), which has been at 100% rollout with no property filters since 2025-10-10 and is now marked stale in PostHog.
  • Deletes the constant from mitxpro/features.py.
  • Removes the is_enabled(...) guard in ecommerce/mail_api.py:send_course_run_enrollment_welcome_email, so the welcome email always sends (matching current production behavior).
  • Removes the disabled-path test case from ecommerce/mail_api_test.py.
Implementation details

mitxpro was the only consumer of this flag. The only guard was the early return at the top of send_course_run_enrollment_welcome_email; callers (courses/api.py, courses/management/utils.py) only invoke that wrapper and never reference the flag directly, so no changes were needed there. Also removed the now-unused is_enabled and features imports from ecommerce/mail_api.py, and the now-unused ENROLLMENT_WELCOME_EMAIL import from the test file. The parametrized test (enabled=True/False) was collapsed to a single unparametrized test covering the always-enabled path.

Per the issue, the PostHog flag itself will be archived (not deleted) after this deploys to production and past the revert window — that step is manual and out of scope for this PR.

How can this be tested?

  • Configure your xPRO instance with edx instance
  • If you have not already, archieve the xpro-enrollment-welcome-email in PostHog such that the flag value doesn't have any impact on the welcome emails.
  • Enroll in a course
  • You should receive the welcome email anyway.
  • CI should pass

@arslanashraf7
arslanashraf7 force-pushed the arslan/remove-welcome-email-flag branch from 7dcd380 to 062959e Compare September 11, 2026 13:10
@arslanashraf7
arslanashraf7 marked this pull request as ready for review September 14, 2026 11:40
The flag has been at 100% rollout with no filters since 2025-10-10 and
PostHog now marks it stale. Removes the constant, the is_enabled guard
in send_course_run_enrollment_welcome_email, and the disabled-path test
case, so the welcome email always sends.

Ref: mitodl/hq#12661

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@arslanashraf7
arslanashraf7 force-pushed the arslan/remove-welcome-email-flag branch from 062959e to bc23892 Compare September 14, 2026 11:41
@Anas12091101 Anas12091101 self-assigned this Sep 14, 2026
@arslanashraf7
arslanashraf7 merged commit 7c8c2a6 into master Sep 14, 2026
8 checks passed
@arslanashraf7
arslanashraf7 deleted the arslan/remove-welcome-email-flag branch September 14, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants