Skip to content

Commit

Permalink
Disable pgp onboarding proton mail (#2122)
Browse files Browse the repository at this point in the history
* show app page

* Do not send onboarding PGP email to Proton mailbox

---------

Co-authored-by: Son NK <[email protected]>
  • Loading branch information
nguyenkims and Son NK authored Jun 10, 2024
1 parent 8a77a8b commit 209ed65
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,18 @@ def process_job(job: Job):
onboarding_mailbox(user)
elif job.name == config.JOB_ONBOARDING_4:
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
# or disable the notification
if user and user.notification and user.activated:
LOG.d("send onboarding pgp email to user %s", user)
onboarding_pgp(user)
# if user only has 1 mailbox which is Proton then do not send PGP onboarding email
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:
batch_import_id = job.payload.get("batch_import_id")
Expand Down

0 comments on commit 209ed65

Please sign in to comment.