Changeset - 9207087a64c5
[Not reviewed]
0 1 0
Lance Edgar (lance) - 4 months ago 2024-07-04 21:24:15
lance@edbob.org
fix: specify default list for rattail mail templates

not sure how this never came up before?
1 file changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rattail/mail.py
Show inline comments
 
@@ -43,7 +43,7 @@ from rattail import exceptions
 
from rattail.core import UNSPECIFIED
 
from rattail.files import resource_path
 
from rattail.util import load_entry_points
 
from rattail.time import localtime, make_utc
 
from rattail.time import localtime
 

	
 

	
 
# NOTE: this bit of magic was stolen from Django
 
@@ -273,7 +273,7 @@ class EmailHandler(object):
 
        attempt.cc = msg.get_all('Cc')
 
        attempt.bcc = msg.get_all('Bcc')
 
        attempt.subject = msg['Subject']
 
        attempt.sent = make_utc()
 
        attempt.sent = self.app.make_utc()
 
        attempt.status_code = self.enum.EMAIL_ATTEMPT_CREATED
 
        session.add(attempt)
 

	
 
@@ -430,7 +430,8 @@ class Email(object):
 
        if default_subject:
 
            self.default_subject = default_subject
 

	
 
        templates = config.getlist('rattail.mail', 'templates')
 
        templates = config.getlist('rattail.mail', 'templates',
 
                                   default=['rattail:templates/mail'])
 
        if templates:
 
            templates = [resource_path(p) for p in templates]
 
        self.txt_templates = TemplateLookup(directories=templates)
0 comments (0 inline, 0 general)