summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-09-27 16:32:21 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-09-27 16:32:21 +0000
commit2d1303bd68ee42e5c8014e2b479fc0f11cb8c08d (patch)
tree7e5913aa6331c4f2f9f7114b883b41f37334d1e4 /django/core
parentcac99144fd7fb38f485be9fb049d380bc6415f9d (diff)
Added EMAIL_SUBJECT_PREFIX setting so you can customize the "[Django]" prefix
on emails send with mail_admins/mail_managers. Refs #568. git-svn-id: http://code.djangoproject.com/svn/django/trunk@710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core')
-rw-r--r--django/core/mail.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/core/mail.py b/django/core/mail.py
index ec84ee3b3b..24a85d77f0 100644
--- a/django/core/mail.py
+++ b/django/core/mail.py
@@ -1,6 +1,6 @@
# Use this module for e-mailing.
-from django.conf.settings import DEFAULT_FROM_EMAIL, EMAIL_HOST
+from django.conf.settings import DEFAULT_FROM_EMAIL, EMAIL_HOST, EMAIL_SUBJECT_PREFIX
from email.MIMEText import MIMEText
import smtplib
@@ -41,9 +41,9 @@ def send_mass_mail(datatuple, fail_silently=False):
def mail_admins(subject, message, fail_silently=False):
"Sends a message to the admins, as defined by the ADMINS constant in settings.py."
from django.conf.settings import ADMINS, SERVER_EMAIL
- send_mail('[Django] ' + subject, message, SERVER_EMAIL, [a[1] for a in ADMINS], fail_silently)
+ send_mail(EMAIL_SUBJECT_PREFIX + subject, message, SERVER_EMAIL, [a[1] for a in ADMINS], fail_silently)
def mail_managers(subject, message, fail_silently=False):
"Sends a message to the managers, as defined by the MANAGERS constant in settings.py"
from django.conf.settings import MANAGERS, SERVER_EMAIL
- send_mail('[Django] ' + subject, message, SERVER_EMAIL, [a[1] for a in MANAGERS], fail_silently)
+ send_mail(EMAIL_SUBJECT_PREFIX + subject, message, SERVER_EMAIL, [a[1] for a in MANAGERS], fail_silently)