Send notifications when subscription tier changes #59
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a user's subscription tier changes (via admin override, user upgrade/downgrade, or grace period auto-downgrade), they should receive both an email notification and an in-app notification.
Related
Current Behavior
Tier changes occur without notifying the user.
Expected Behavior
Email notification sent when tier changes with details:
In-app notification displayed in notification bell with same details
Implementation Notes
The notification infrastructure already exists (
backend/src/features/notifications/). This requires:TemplateKeytype to include'subscription_tier_change'sendTierChangeNotification()to NotificationsServiceSubscriptionsService.adminOverrideTier()SubscriptionsService.upgradeSubscription()SubscriptionsService.downgradeSubscription()grace-period.job.tsAcceptance Criteria
Milestone: Implementation Complete
Phase: Execution | Agent: Developer | Status: PASS
Completed Tasks
Extended TemplateKey type - Added
'subscription_tier_change'to the TemplateKey union type and Zod schema innotifications.types.tsCreated migration for email template - Added
007_subscription_tier_change_template.sqlwith:Added sendTierChangeNotification() to NotificationsService - New method that:
Integrated into SubscriptionsService - Added notification calls to:
upgradeSubscription()- reason:user_upgradedowngradeSubscription()- reason:user_downgradeadminOverrideTier()- reason:admin_overrideIntegrated into grace-period.job.ts - Sends notification on auto-downgrade:
grace_period_expirationVerification
Files Changed
backend/src/features/notifications/domain/notifications.types.tsbackend/src/features/notifications/domain/notifications.service.tsbackend/src/features/notifications/migrations/007_subscription_tier_change_template.sqlbackend/src/features/subscriptions/domain/subscriptions.service.tsbackend/src/features/subscriptions/jobs/grace-period.job.tsVerdict: PASS | Next: Open PR for review