Disable pgp onboarding proton mail (#2122)
* show app page * Do not send onboarding PGP email to Proton mailbox --------- Co-authored-by: Son NK <son@simplelogin.io>
This commit is contained in:
parent
8a77a8b251
commit
209ed65ebc
|
@ -198,13 +198,18 @@ def process_job(job: Job):
|
||||||
onboarding_mailbox(user)
|
onboarding_mailbox(user)
|
||||||
elif job.name == config.JOB_ONBOARDING_4:
|
elif job.name == config.JOB_ONBOARDING_4:
|
||||||
user_id = job.payload.get("user_id")
|
user_id = job.payload.get("user_id")
|
||||||
user = User.get(user_id)
|
user: User = User.get(user_id)
|
||||||
|
|
||||||
# user might delete their account in the meantime
|
# user might delete their account in the meantime
|
||||||
# or disable the notification
|
# or disable the notification
|
||||||
if user and user.notification and user.activated:
|
if user and user.notification and user.activated:
|
||||||
LOG.d("send onboarding pgp email to user %s", user)
|
# if user only has 1 mailbox which is Proton then do not send PGP onboarding email
|
||||||
onboarding_pgp(user)
|
mailboxes = user.mailboxes()
|
||||||
|
if len(mailboxes) == 1 and mailboxes[0].is_proton():
|
||||||
|
LOG.d("Do not send onboarding PGP email to Proton mailbox")
|
||||||
|
else:
|
||||||
|
LOG.d("send onboarding pgp email to user %s", user)
|
||||||
|
onboarding_pgp(user)
|
||||||
|
|
||||||
elif job.name == config.JOB_BATCH_IMPORT:
|
elif job.name == config.JOB_BATCH_IMPORT:
|
||||||
batch_import_id = job.payload.get("batch_import_id")
|
batch_import_id = job.payload.get("batch_import_id")
|
||||||
|
|
Loading…
Reference in New Issue