From: Guillaume Pellerin Date: Mon, 22 Apr 2013 15:07:01 +0000 (+0200) Subject: Merge remote-tracking branch 'hg/master' X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=dd183bc7371a66151a6179981ee4635a02f55079;p=django-postman.git Merge remote-tracking branch 'hg/master' --- dd183bc7371a66151a6179981ee4635a02f55079 diff --cc postman/utils.py index eeaf998,f7d5d7c..bcc67ba --- a/postman/utils.py +++ b/postman/utils.py @@@ -22,12 -23,9 +23,12 @@@ else # but if not installed or not desired, fallback to django.core.mail name = getattr(settings, 'POSTMAN_MAILER_APP', 'mailer') if name and name in settings.INSTALLED_APPS: - send_mail = __import__(name, globals(), locals(), ['send_mail']).send_mail + send_mail = __import__(name, globals(), locals(), [str('send_mail')]).send_mail else: - from django.core.mail import send_mail + from django.core.mail import send_mail, mail_admins + +# to disable email notification to users +DISABLE_USER_EMAILING = getattr(settings, 'POSTMAN_DISABLE_USER_EMAILING', False) # to disable email notification to users DISABLE_USER_EMAILING = getattr(settings, 'POSTMAN_DISABLE_USER_EMAILING', False) @@@ -74,8 -75,8 +78,9 @@@ def email(subject_template, message_tem message = render_to_string(message_template, ctx_dict) # during the development phase, consider using the setting: EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True) + mail_admins(subject, message) + def email_visitor(object, action): """Email a visitor.""" email('postman/email_visitor_subject.txt', 'postman/email_visitor.txt', [object.email], object, action)