mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-18 07:36:55 +02:00
Added a warning if no message notification template found in database
This commit is contained in:
parent
89cc11cb8e
commit
7b594cfdc0
@ -17,6 +17,9 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from base64 import decodestring as b64decode
|
from base64 import decodestring as b64decode
|
||||||
|
|
||||||
|
import logging
|
||||||
|
logger = logging.getLogger('helpdesk')
|
||||||
|
|
||||||
from django.utils.encoding import smart_str
|
from django.utils.encoding import smart_str
|
||||||
|
|
||||||
def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None):
|
def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None):
|
||||||
@ -66,6 +69,8 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
|
|||||||
try:
|
try:
|
||||||
t = EmailTemplate.objects.get(template_name__iexact=template_name, locale__isnull=True)
|
t = EmailTemplate.objects.get(template_name__iexact=template_name, locale__isnull=True)
|
||||||
except EmailTemplate.DoesNotExist:
|
except EmailTemplate.DoesNotExist:
|
||||||
|
logger.warning('template "%s" does not exist, no mail sent' %
|
||||||
|
template_name)
|
||||||
return # just ignore if template doesn't exist
|
return # just ignore if template doesn't exist
|
||||||
|
|
||||||
if not sender:
|
if not sender:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user