Skip to content

PM-5763: Send localized phase notifications - #140

Merged
jmgasper merged 1 commit into
developfrom
PM-5763-1
Jul 31, 2026
Merged

PM-5763: Send localized phase notifications#140
jmgasper merged 1 commit into
developfrom
PM-5763-1

Conversation

@jmgasper

Copy link
Copy Markdown
Contributor

What was broken

Manual phase changes published one shared email with raw timestamps for all challenge resources, without honoring each resource's phase-notification preference or member timezone.

Root cause

The manual phase update path built one common template payload and did not load recipient profile locations, so the timestamp and subject could not be personalized.

What was changed

  • Filter to resources that opted into phase-change notifications.
  • Publish one external.action.email event per unique recipient.
  • Resolve profile locations in bounded batches and default unresolved locations to UTC.
  • Format transition times as MMMM DD, YYYY HH:mm z.
  • Add localized_time and phase_change while retaining the existing phase template fields.
  • Remove full member-profile response logging from the lookup used by this flow.

Any added/updated tests

  • Added phase service coverage for individual delivery, preference filtering, email deduplication, local and UTC timestamps, country fallback, open and closed payloads, and reopen wording.
  • The affected ChallengePhaseService suite passes all 51 tests.
  • pnpm lint: passed.
  • pnpm build: passed.
  • The repository-wide pnpm test command was also run; it currently reports 143 unrelated existing failures across legacy suites. The changed phase suite is fully green.

What was broken

Manual phase changes published one shared email with raw timestamps for all challenge resources, without honoring each resource's phase-notification preference or member timezone.

Root cause

The manual phase update path built one common template payload and did not load recipient profile locations, so the timestamp and subject could not be personalized.

What was changed

Filter to opted-in resources and publish one external.action.email event per unique recipient. Resolve profile locations in bounded batches, default unresolved locations to UTC, format times as MMMM DD, YYYY HH:mm z, and add localized_time and phase_change while preserving the legacy template fields. Removed member profile response logging from the lookup used by this flow.

Any added/updated tests

Added phase service coverage for individual delivery, preference filtering, email deduplication, local and UTC timestamps, country fallback, open and closed payloads, and reopen wording.
@jmgasper
jmgasper merged commit d58f17f into develop Jul 31, 2026
5 checks passed
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.

1 participant