Skip to content

Commit edd08f3

Browse files
committed
Log sent mail.
Use the right template for the subject. - Legacy-Id: 164
1 parent cb94159 commit edd08f3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/utils/mail.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from django.conf import settings
77
from django.template.loader import render_to_string
88
from django.template import RequestContext
9+
from ietf.utils import log
910

1011
def add_headers(msg):
1112
if not(msg.has_key('Message-ID')):
@@ -34,6 +35,7 @@ def send_smtp(msg):
3435
server.login(settings.EMAIL_HOST_USER, settings.EMAIL_HOST_PASSWORD)
3536
server.sendmail(frm, to, msg.as_string())
3637
server.quit()
38+
log("sent email from '%s' to '%s' subject '%s'" % (frm, to, msg.get('Subject', '[no subject]')))
3739

3840
def copy_email(msg, to):
3941
'''
@@ -62,7 +64,7 @@ def send_mail_subj(request, to, frm, stemplate, template, context, cc=None, extr
6264
Send an email message, exactly as send_mail(), but the
6365
subject field is a template.
6466
'''
65-
subject = render_to_string(template, context, context_instance=RequestContext(request))
67+
subject = render_to_string(stemplate, context, context_instance=RequestContext(request))
6668
return send_mail(request, to, frm, subject, template, context, cc, extra)
6769

6870
def send_mail(request, to, frm, subject, template, context, cc=None, extra=None):

0 commit comments

Comments
 (0)