mirror of
https://github.com/simple-login/app.git
synced 2024-11-14 08:01:13 +01:00
Merge pull request #82 from simple-login/fix-trial-end-email
only send trial-end email to user who is in trial
This commit is contained in:
commit
100305c4bf
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