fix: defer expiry reminders for trial and bonus subscriptions
Trial and registration/referral-bonus subscriptions usually last only a few days, so the multi-day ending-soon reminders fired almost the moment they were granted and needlessly alarmed newcomers. Track this with a new subscription flag (suppress_early_expiry_notifications, migration 0035): trial activation, referral welcome bonus and inviter bonus grants set it, while a real paid purchase clears it on upsert. While set, the notification worker skips the day-before stages but still sends the hours-before reminder and the expiry/after-expiry notices, so users are warned shortly before access ends. Once they pay for a full subscription the complete reminder spectrum resumes.
This commit is contained in:
@@ -153,6 +153,15 @@ class SubscriptionNotificationWorker:
|
||||
hours_before=hours_before,
|
||||
)
|
||||
|
||||
# Trial and registration/referral-bonus subscriptions last only a
|
||||
# few days, so a multi-day "ending soon" reminder would fire almost
|
||||
# the moment they are granted and needlessly alarm newcomers. Skip
|
||||
# the day-before stages for them — they still get the hours-before
|
||||
# reminder above and the expiry/after-expiry notices below. Paying
|
||||
# for a real subscription clears the flag and restores all stages.
|
||||
if bool(getattr(sub, "suppress_early_expiry_notifications", False)):
|
||||
return None
|
||||
|
||||
days_before_limit = max(
|
||||
0,
|
||||
int(getattr(self.settings, "SUBSCRIPTION_NOTIFY_DAYS_BEFORE", 0) or 0),
|
||||
|
||||
Reference in New Issue
Block a user