Browse Source

Moved mail settings to global settings file

master
Niklas Brachmann 11 years ago
parent
commit
1bfc485eea
  1. 3
      cash/management/commands/dailydigest.py
  2. 2
      lugcash2/settings.py

3
cash/management/commands/dailydigest.py

@ -6,6 +6,7 @@ from django.template import Context @@ -6,6 +6,7 @@ from django.template import Context
from django.utils import translation
from django.utils.dateformat import DateFormat
from django.utils.formats import get_format
from django.conf import settings
from django.core.mail import send_mass_mail
import datetime
@ -45,6 +46,6 @@ class Command(NoArgsCommand): @@ -45,6 +46,6 @@ class Command(NoArgsCommand):
context['tl'] = transactions
context['sum'] = sum
messages.append((_('Account Statement'), tpl.render(Context(context)), 'cypher@lug-saar.de', ['%s %s <%s>' % (a.user.first_name, a.user.last_name, a.user.email)]))
messages.append(('%s%s' % (settings.EMAIL_SUBJECT_PREFIX, _('Account Statement')), tpl.render(Context(context)), settings.DEFAULT_FROM_EMAIL, ['%s %s <%s>' % (a.user.first_name, a.user.last_name, a.user.email)]))
send_mass_mail(tuple(messages))

2
lugcash2/settings.py

@ -195,4 +195,6 @@ AUTH_LDAP_USER_FLAGS_BY_GROUP = { @@ -195,4 +195,6 @@ AUTH_LDAP_USER_FLAGS_BY_GROUP = {
# Use console output for testing
# TODO: change
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_SUBJECT_PREFIX = '[LUGSaar Kassensystem] '
DEFAULT_FROM_EMAIL = 'cypher@lug-saar.de'

Loading…
Cancel
Save