Fixed Mail object attr instaciation
This commit is contained in:
parent
49545015c8
commit
e3e76872a5
|
@ -19,6 +19,10 @@ class Email(object):
|
||||||
def __init__(self, context={}):
|
def __init__(self, context={}):
|
||||||
self.from_email = getattr(settings, 'FROM_EMAIL', 'root@localhost')
|
self.from_email = getattr(settings, 'FROM_EMAIL', 'root@localhost')
|
||||||
self.context = context
|
self.context = context
|
||||||
|
self.recipients = []
|
||||||
|
self.template = ''
|
||||||
|
self.text = ''
|
||||||
|
self.subject = ''
|
||||||
self.prepare()
|
self.prepare()
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
|
@ -27,9 +31,7 @@ class Email(object):
|
||||||
def compile_template(self):
|
def compile_template(self):
|
||||||
tmpl = get_template(self.template)
|
tmpl = get_template(self.template)
|
||||||
self.html = tmpl.render(Context(self.context))
|
self.html = tmpl.render(Context(self.context))
|
||||||
print(self.html.encode('utf-8'))
|
|
||||||
self.text = strip_tags(self.html)
|
self.text = strip_tags(self.html)
|
||||||
print(self.text.encode('utf-8'))
|
|
||||||
|
|
||||||
def send(self):
|
def send(self):
|
||||||
if self.template:
|
if self.template:
|
||||||
|
|
Reference in New Issue