diff --git a/confirmation/views.py b/confirmation/views.py index 3053efeccb..dc8bf80f62 100644 --- a/confirmation/views.py +++ b/confirmation/views.py @@ -34,7 +34,6 @@ def confirm(request, confirmation_key): 'key': confirmation_key, 'full_name': request.GET.get("full_name", None), 'support_email': settings.ZULIP_ADMINISTRATOR, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, } templates = [ 'confirmation/confirm.html', diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index e59f0b9421..dabeb69590 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -632,7 +632,6 @@ def do_start_email_change_process(user_profile, new_email): user_profile.email = new_email context = {'support_email': settings.ZULIP_ADMINISTRATOR, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, 'realm': user_profile.realm, 'old_email': old_email, 'new_email': new_email, @@ -3055,8 +3054,7 @@ def do_send_confirmation_email(invitee, referrer, body): `referrer` is a UserProfile. """ context = {'referrer': referrer, - 'support_email': settings.ZULIP_ADMINISTRATOR, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS} + 'support_email': settings.ZULIP_ADMINISTRATOR} if referrer.realm.is_zephyr_mirror_realm: template_prefix = 'zerver/emails/invitation_mit' diff --git a/zerver/lib/notifications.py b/zerver/lib/notifications.py index b55d58d33c..1bcd33838d 100644 --- a/zerver/lib/notifications.py +++ b/zerver/lib/notifications.py @@ -404,7 +404,6 @@ def enqueue_welcome_emails(email, name): unsubscribe_link = one_click_unsubscribe_link(user_profile, "welcome") context = common_context(user_profile) context.update({ - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, 'unsubscribe_link': unsubscribe_link }) send_future_email( diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py index e69e1dcaa7..a4c3eff05a 100644 --- a/zerver/lib/send_email.py +++ b/zerver/lib/send_email.py @@ -19,6 +19,9 @@ def display_email(user): # Intended only for test code def build_email(template_prefix, to_email, from_email=None, reply_to_email=None, context={}): # type: (str, Text, Optional[Text], Optional[Text], Dict[str, Any]) -> EmailMultiAlternatives + context.update({ + 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, + }) subject = loader.render_to_string(template_prefix + '.subject', context=context, using='Jinja2_plaintext').strip() message = loader.render_to_string(template_prefix + '.txt', diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py index 3ec40f5428..05608b26f4 100644 --- a/zerver/tests/test_signup.py +++ b/zerver/tests/test_signup.py @@ -739,7 +739,6 @@ so we didn't send them an invitation. We did send invitations to everyone else!" 'referrer_name': referrer.full_name, 'referrer_email': referrer.email, 'referrer_realm_name': referrer.realm.name, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, 'support_email': settings.ZULIP_ADMINISTRATOR }) with self.settings(EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend'): diff --git a/zerver/views/registration.py b/zerver/views/registration.py index d3cac46023..782c5ab890 100644 --- a/zerver/views/registration.py +++ b/zerver/views/registration.py @@ -308,8 +308,7 @@ def send_registration_completion_email(email, request, realm_creation=False): template_prefix = 'zerver/emails/confirm_registration_mit' prereg_user = create_preregistration_user(email, request, realm_creation) - context = {'support_email': settings.ZULIP_ADMINISTRATOR, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS} + context = {'support_email': settings.ZULIP_ADMINISTRATOR} return Confirmation.objects.send_confirmation(prereg_user, template_prefix, email, additional_context=context, host=request.get_host()) diff --git a/zerver/views/user_settings.py b/zerver/views/user_settings.py index 327aa84d8e..feaee94d6b 100644 --- a/zerver/views/user_settings.py +++ b/zerver/views/user_settings.py @@ -49,7 +49,6 @@ def confirm_email_change(request, confirmation_key): do_change_user_email(obj.user_profile, obj.new_email) context = {'support_email': settings.ZULIP_ADMINISTRATOR, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, 'realm': obj.realm, 'new_email': new_email, } @@ -59,7 +58,6 @@ def confirm_email_change(request, confirmation_key): ctx = { 'confirmed': confirmed, 'support_email': settings.ZULIP_ADMINISTRATOR, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, 'new_email': new_email, 'old_email': old_email, } diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index 1e16bef3ab..824c9823fa 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -174,7 +174,6 @@ class ConfirmationEmailWorker(QueueProcessingWorker): 'referrer_name': referrer.full_name, 'referrer_email': referrer.email, 'referrer_realm_name': referrer.realm.name, - 'verbose_support_offers': settings.VERBOSE_SUPPORT_OFFERS, 'support_email': settings.ZULIP_ADMINISTRATOR }) send_future_email(