diff --git a/templates/zerver/integrations/email.md b/templates/zerver/integrations/email.md index d02193be63..3aed7f7e05 100644 --- a/templates/zerver/integrations/email.md +++ b/templates/zerver/integrations/email.md @@ -28,7 +28,7 @@ The default behavior of this integration is designed to be convenient in the common case. We offer a few options for overriding the default behavior, configured by editing the Zulip email address: -Example: `{{ email_gateway_example_with_options }}` +Example: `general.abcd1234.show-sender.include-footer@example.zulipchat.com` * `show-sender`: Will cause `From: ` to be displayed at the top of Zulip messages sent via this integration. diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py index 79b1f08f5c..2def4c3864 100644 --- a/zerver/lib/integrations.py +++ b/zerver/lib/integrations.py @@ -1,7 +1,6 @@ import os from typing import Dict, List, Optional, Any -from django.conf import settings from django.conf.urls import url from django.contrib.staticfiles.storage import staticfiles_storage from django.urls.resolvers import LocaleRegexProvider @@ -128,10 +127,6 @@ class BotIntegration(Integration): doc = self.DEFAULT_DOC_PATH.format(name=name) self.doc = doc -class EmailIntegration(Integration): - def is_enabled(self) -> bool: - return settings.EMAIL_GATEWAY_PATTERN != "" - class WebhookIntegration(Integration): DEFAULT_FUNCTION_PATH = 'zerver.webhooks.{name}.view.api_{name}_webhook' DEFAULT_URL = 'api/v1/external/{name}' @@ -354,8 +349,8 @@ INTEGRATIONS = { doc='zerver/integrations/codebase.md'), 'discourse': Integration('discourse', 'discourse', ['communication'], doc='zerver/integrations/discourse.md'), - 'email': EmailIntegration('email', 'email', ['communication'], - doc='zerver/integrations/email.md'), + 'email': Integration('email', 'email', ['communication'], + doc='zerver/integrations/email.md'), 'errbot': Integration('errbot', 'errbot', ['meta-integration', 'bots'], doc='zerver/integrations/errbot.md'), 'git': Integration('git', 'git', ['version-control'], diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 050eecf055..5de2d8da2f 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -206,17 +206,6 @@ class DocPageTest(ZulipTestCase): self._test(url, title, doc_html_str=True) self._test(url, description, doc_html_str=True) - def test_email_integration(self) -> None: - self._test('/integrations/doc-html/email', - 'support.abcd1234@testserver', doc_html_str=True) - - with self.settings(EMAIL_GATEWAY_PATTERN=''): - result = self.get_doc('integrations/doc-html/email', subdomain='zulip') - self.assertNotIn('support.abcd1234@testserver', str(result.content)) - # if EMAIL_GATEWAY_PATTERN is empty, the main /integrations page should - # be rendered instead - self._test('/integrations/', 'native integrations.') - def test_doc_html_str_non_ajax_call(self) -> None: # We don't need to test all the pages for 404 for integration in list(INTEGRATIONS.keys())[5]: diff --git a/zerver/views/documentation.py b/zerver/views/documentation.py index e9f45da2ed..bb5d3fc8f1 100644 --- a/zerver/views/documentation.py +++ b/zerver/views/documentation.py @@ -10,7 +10,7 @@ import random import re from zerver.lib.integrations import CATEGORIES, INTEGRATIONS, HubotIntegration, \ - WebhookIntegration, EmailIntegration + WebhookIntegration from zerver.lib.request import has_request_variables, REQ from zerver.lib.subdomains import get_subdomain from zerver.models import Realm @@ -193,9 +193,6 @@ def integration_doc(request: HttpRequest, integration_name: str=REQ(default=None context['integration_url'] = integration.url[3:] if isinstance(integration, HubotIntegration): context['hubot_docs_url'] = integration.hubot_docs_url - if isinstance(integration, EmailIntegration): - context['email_gateway_example'] = settings.EMAIL_GATEWAY_EXAMPLE - context['email_gateway_example_with_options'] = settings.EMAIL_GATEWAY_EXAMPLE_WITH_OPTIONS doc_html_str = render_markdown_path(integration.doc, context) diff --git a/zproject/settings.py b/zproject/settings.py index d4b9b5dd40..0a636d35e3 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -827,14 +827,6 @@ for bot in INTERNAL_BOTS + REALM_INTERNAL_BOTS + DISABLED_REALM_INTERNAL_BOTS: bot_email = bot['email_template'] % (INTERNAL_BOT_DOMAIN,) vars()[bot['var_name']] = bot_email -if EMAIL_GATEWAY_PATTERN != "": - EMAIL_GATEWAY_EXAMPLE = EMAIL_GATEWAY_PATTERN % ("support.abcd1234",) - EMAIL_GATEWAY_EXAMPLE_WITH_OPTIONS = EMAIL_GATEWAY_PATTERN % ( - "support.abcd1234.first-option.second-option",) -else: - EMAIL_GATEWAY_EXAMPLE = "" - EMAIL_GATEWAY_EXAMPLE_WITH_OPTIONS = "" - ######################################################################## # STATSD CONFIGURATION ########################################################################