summaryrefslogtreecommitdiffstats
path: root/askbot/mail
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-06-12 01:25:32 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-06-12 01:25:32 -0400
commit350c19cb1c613ce0181b0f919a7610f44656f9f7 (patch)
tree40b4c4f96d009a7f58f7bad2d4b4f9f90b9eacf3 /askbot/mail
parentc392f3187178999e6c06da120f1f7b2f3e99d022 (diff)
downloadaskbot-350c19cb1c613ce0181b0f919a7610f44656f9f7.tar.gz
askbot-350c19cb1c613ce0181b0f919a7610f44656f9f7.tar.bz2
askbot-350c19cb1c613ce0181b0f919a7610f44656f9f7.zip
added simple tag moderation via email and edited the changelog
Diffstat (limited to 'askbot/mail')
-rw-r--r--askbot/mail/__init__.py14
-rw-r--r--askbot/mail/messages.py11
2 files changed, 23 insertions, 2 deletions
diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py
index 7ff8a2d3..1c32f14d 100644
--- a/askbot/mail/__init__.py
+++ b/askbot/mail/__init__.py
@@ -122,7 +122,9 @@ def send_mail(
def mail_moderators(
subject_line = '',
body_text = '',
- raise_on_failure = False):
+ raise_on_failure = False,
+ headers = None
+ ):
"""sends email to forum moderators and admins
"""
from django.db.models import Q
@@ -139,7 +141,15 @@ def mail_moderators(
from_email = django_settings.DEFAULT_FROM_EMAIL
try:
- mail.send_mail(subject_line, body_text, from_email, recipient_list)
+ msg = mail.EmailMessage(
+ subject_line,
+ body_text,
+ from_email,
+ recipient_list,
+ headers = headers or {}
+ )
+ msg.content_subtype = 'html'
+ msg.send()
except smtplib.SMTPException, error:
logging.critical(unicode(error))
if raise_on_failure == True:
diff --git a/askbot/mail/messages.py b/askbot/mail/messages.py
index 24091971..3ab3ff2f 100644
--- a/askbot/mail/messages.py
+++ b/askbot/mail/messages.py
@@ -32,6 +32,17 @@ def ask_for_signature(user, footer_code = None):
'footer_code': footer_code
}
+@message(template = 'email/notify_admins_about_new_tags.html')
+def notify_admins_about_new_tags(
+ tags = None, thread = None, user = None
+):
+ thread_url = thread.get_absolute_url()
+ return {
+ 'thread_url': html_utils.site_url(thread_url),
+ 'tags': tags,
+ 'user': user
+ }
+
@message(template = 'email/insufficient_rep_to_post_by_email.html')
def insufficient_reputation(user):
"""tells user that he does not have