Issue #84: If an e-mail template doesn't exist, don't send the e-mail.

As requested (and patch provided by) flywheelnetworks.
This commit is contained in:
Ross Poulton 2009-08-04 12:26:35 +00:00
parent 4d264eaa28
commit 8d95221000

5
lib.py
View File

@ -67,7 +67,10 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
pass
if not t:
t = EmailTemplate.objects.get(template_name__iexact=template_name)
try:
t = EmailTemplate.objects.get(template_name__iexact=template_name)
except EmailTemplate.DoesNotExist:
return # just ignore if template doesn't exist
if not sender:
sender = settings.DEFAULT_FROM_EMAIL