org-settings: Add setting to turn off welcome emails.

This adds an organization-level setting to provide an option to turn
off the welcome emails.

Fixes #8000.
This commit is contained in:
Aastha Gupta
2018-02-18 14:04:54 +05:30
committed by Tim Abbott
parent 71829f3373
commit d124597f4b
9 changed files with 45 additions and 2 deletions

View File

@@ -363,7 +363,8 @@ def process_new_human_user(user_profile: UserProfile,
PreregistrationUser.objects.filter(email__iexact=user_profile.email).update(status=0)
notify_new_user(user_profile)
enqueue_welcome_emails(user_profile)
if user_profile.realm.send_welcome_emails:
enqueue_welcome_emails(user_profile)
# We have an import loop here; it's intentional, because we want
# to keep all the onboarding code in zerver/lib/onboarding.py.