diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 00e88b0cf3..775e0134d7 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -93,7 +93,8 @@ from zerver.lib.utils import log_statsd_event, statsd from zerver.lib.html_diff import highlight_html_differences from zerver.lib.alert_words import user_alert_words, add_user_alert_words, \ remove_user_alert_words, set_user_alert_words -from zerver.lib.notifications import clear_scheduled_emails, clear_scheduled_invitation_emails +from zerver.lib.notifications import clear_scheduled_emails, \ + clear_scheduled_invitation_emails, enqueue_welcome_emails from zerver.lib.narrow import check_supported_events_narrow_filter from zerver.lib.exceptions import JsonableError, ErrorCode from zerver.lib.sessions import delete_user_sessions @@ -355,6 +356,7 @@ def process_new_human_user(user_profile, prereg_user=None, newsletter_data=None) PreregistrationUser.objects.filter(email__iexact=user_profile.email).update(status=0) notify_new_user(user_profile) + enqueue_welcome_emails(user_profile.id) if newsletter_data is not None: # If the user was created automatically via the API, we may diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 2321e92ce2..bf925cd6c2 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -314,7 +314,7 @@ class LoginTest(ZulipTestCase): with queries_captured() as queries: self.register(self.nonreg_email('test'), "test") # Ensure the number of queries we make is not O(streams) - self.assert_length(queries, 63) + self.assert_length(queries, 68) user_profile = self.nonreg_user('test') self.assertEqual(get_session_dict_user(self.client.session), user_profile.id) self.assertFalse(user_profile.enable_stream_desktop_notifications) diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index b3b153c1aa..bccce5c2fb 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -167,8 +167,6 @@ class SignupWorker(QueueProcessingWorker): else: r.raise_for_status() - enqueue_welcome_emails(data['user_id']) - @assign_queue('invites') class ConfirmationEmailWorker(QueueProcessingWorker): def consume(self, data):