fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Fixed Mail object attr instaciation

This commit is contained in:
Felipe 2015-01-29 10:21:41 +01:00
parent 49545015c8
commit e3e76872a5
1 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,10 @@ class Email(object):
def __init__(self, context={}):
self.from_email = getattr(settings, 'FROM_EMAIL', 'root@localhost')
self.context = context
self.recipients = []
self.template = ''
self.text = ''
self.subject = ''
self.prepare()
def prepare(self):
@ -27,9 +31,7 @@ class Email(object):
def compile_template(self):
tmpl = get_template(self.template)
self.html = tmpl.render(Context(self.context))
print(self.html.encode('utf-8'))
self.text = strip_tags(self.html)
print(self.text.encode('utf-8'))
def send(self):
if self.template: