mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 07:13:18 +08:00
only send trial-end email to user who is in trial
i.e. users who: 1. has lifetime licence or active subscription and 2. is in trial period
This commit is contained in:
parent
83c2bb2b23
commit
4ad44dbcdf
1 changed files with 3 additions and 1 deletions
4
cron.py
4
cron.py
|
@ -22,7 +22,9 @@ def notify_trial_end():
|
|||
for user in User.query.filter(
|
||||
User.activated == True, User.trial_end.isnot(None), User.lifetime == False
|
||||
).all():
|
||||
if arrow.now().shift(days=3) > user.trial_end >= arrow.now().shift(days=2):
|
||||
if user.in_trial() and arrow.now().shift(
|
||||
days=3
|
||||
) > user.trial_end >= arrow.now().shift(days=2):
|
||||
LOG.d("Send trial end email to user %s", user)
|
||||
send_trial_end_soon_email(user)
|
||||
|
||||
|
|
Loading…
Reference in a new issue