mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 07:13:18 +08:00
do not send trial ending soon or onboarding to unactivated user
This commit is contained in:
parent
ccefca5e84
commit
e4bec95b4e
2 changed files with 7 additions and 1 deletions
4
cron.py
4
cron.py
|
@ -19,7 +19,9 @@ from server import create_app
|
|||
|
||||
|
||||
def notify_trial_end():
|
||||
for user in User.query.filter(User.trial_end.isnot(None)).all():
|
||||
for user in User.query.filter(
|
||||
User.activated == True, User.trial_end.isnot(None)
|
||||
).all():
|
||||
if 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)
|
||||
|
|
|
@ -37,6 +37,10 @@ def new_app():
|
|||
|
||||
|
||||
def onboarding_1(user):
|
||||
if not user.activated:
|
||||
LOG.d("User %s is not activated", user)
|
||||
return
|
||||
|
||||
if not user.notification:
|
||||
LOG.d("User %s disable notification setting", user)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue