server settings: Add setting for MAILING_ADDRESS.

The rules here are fuzzy, and it's quite possible none of Zulip's emails
need an address at all. Every country has its own rules though, which makes
it hard to tell. In general, transactional emails do not need an address,
and marketing emails do.
This commit is contained in:
Rishi Gupta 2017-10-18 19:09:53 -07:00 committed by Tim Abbott
parent 63489ebfa5
commit a08543f1ce
5 changed files with 12 additions and 2 deletions

View File

@ -33,7 +33,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="content-block">
<span class="apple-link">Kandra Labs, 112 S Park St, San Francisco CA 94107</span>
<span class="apple-link">{{physical_address}}</span>
{% block manage_preferences %}{% endblock %}
</td>
</tr>

View File

@ -41,6 +41,7 @@ def build_email(template_prefix, to_user_id=None, to_email=None, from_name=None,
'realm_name_in_notifications': False,
'support_email': FromAddress.SUPPORT,
'email_images_base_uri': settings.ROOT_DOMAIN_URI + '/static/images/emails',
'physical_address': settings.PHYSICAL_ADDRESS,
})
subject = loader.render_to_string(template_prefix + '.subject',
context=context,

View File

@ -28,6 +28,7 @@ NOTIFICATION_BOT = "notification-bot@zulip.com"
ERROR_BOT = "error-bot@zulip.com"
NEW_USER_BOT = "new-user-bot@zulip.com"
EMAIL_GATEWAY_BOT = "emailgateway@zulip.com"
PHYSICAL_ADDRESS = "Zulip Headquarters, 123 Octo Stream, South Pacific Ocean"
EXTRA_INSTALLED_APPS = ["zilencer", "analytics"]
# Disable Camo in development
CAMO_URI = ''

View File

@ -81,6 +81,13 @@ EMAIL_USE_TLS = True
# zulip.example.com).
#NOREPLY_EMAIL_ADDRESS = 'noreply@example.com'
# Many countries and bulk mailers require certain types of email to display
# a physical mailing address to comply with anti-spam legislation.
# Non-commercial and non-public-facing installations are unlikely to need
# this setting.
# The address should have no newlines.
#PHYSICAL_ADDRESS = ''
### AUTHENTICATION SETTINGS
#
# Enable at least one of the following authentication backends.

View File

@ -115,9 +115,10 @@ else:
# prod_settings_template.py, and in the initial /etc/zulip/settings.py on a new
# install of the Zulip server.
DEFAULT_SETTINGS = {
# Basic Django email settings
# Basic email settings
'EMAIL_HOST': None,
'NOREPLY_EMAIL_ADDRESS': "noreply@" + EXTERNAL_HOST.split(":")[0],
'PHYSICAL_ADDRESS': '',
# Google auth
'GOOGLE_OAUTH2_CLIENT_ID': None,