Skip to content

Commit

Permalink
Allow overriding of email subject prefix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sihugh committed Apr 1, 2016
1 parent 329e452 commit 6a33cc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conf/general.yml-example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ RATE_LIMIT:
# Email address that errors should be sent to. Optional.
BUGS_EMAIL: '[email protected]'

# 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
Expand Down
3 changes: 3 additions & 0 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 6a33cc6

Please sign in to comment.