From 6a33cc65cc9e5e0b674bd7fef04dd740da13d335 Mon Sep 17 00:00:00 2001 From: Simon Hughesdon Date: Fri, 1 Apr 2016 15:09:23 +0100 Subject: [PATCH] Allow overriding of email subject prefix In GOV.UK we want to specify different email subject lines for MapIt emails in each environment. This change allows the EMAIL_SUBJECT_PREFIX to be set in general.yml. The space after the closing ']' in the example is intentional in order to format the full email subject nicely when it includes following text. --- conf/general.yml-example | 3 +++ project/settings.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/conf/general.yml-example b/conf/general.yml-example index dc3b702a..524dadce 100644 --- a/conf/general.yml-example +++ b/conf/general.yml-example @@ -35,6 +35,9 @@ RATE_LIMIT: # Email address that errors should be sent to. Optional. BUGS_EMAIL: 'example@example.org' +# Text to prepend to the subject of error emails. Overrides Django default. Optional. +EMAIL_SUBJECT_PREFIX: '[MapIt] ' + ######################################################################### # You can ignore all of the settings below this point in the file diff --git a/project/settings.py b/project/settings.py index 8e771a2a..11b1867c 100644 --- a/project/settings.py +++ b/project/settings.py @@ -67,6 +67,9 @@ ('mySociety bugs', config['BUGS_EMAIL']), ) +if config.get('EMAIL_SUBJECT_PREFIX'): + EMAIL_SUBJECT_PREFIX = config['EMAIL_SUBJECT_PREFIX'] + DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis',