mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 20:51:29 +02:00
do not send trial ending soon or onboarding to unactivated user
This commit is contained in:
parent
ccefca5e84
commit
e4bec95b4e
4
cron.py
4
cron.py
@ -19,7 +19,9 @@ from server import create_app
|
|||||||
|
|
||||||
|
|
||||||
def notify_trial_end():
|
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):
|
if arrow.now().shift(days=3) > user.trial_end >= arrow.now().shift(days=2):
|
||||||
LOG.d("Send trial end email to user %s", user)
|
LOG.d("Send trial end email to user %s", user)
|
||||||
send_trial_end_soon_email(user)
|
send_trial_end_soon_email(user)
|
||||||
|
@ -37,6 +37,10 @@ def new_app():
|
|||||||
|
|
||||||
|
|
||||||
def onboarding_1(user):
|
def onboarding_1(user):
|
||||||
|
if not user.activated:
|
||||||
|
LOG.d("User %s is not activated", user)
|
||||||
|
return
|
||||||
|
|
||||||
if not user.notification:
|
if not user.notification:
|
||||||
LOG.d("User %s disable notification setting", user)
|
LOG.d("User %s disable notification setting", user)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user