|
|
|
|
@ -167,7 +167,12 @@ class NewsLetterSender(object): |
|
|
|
|
all the attached files. |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
content_html = self.build_email_content(contact, announce_context, name) |
|
|
|
|
content_html = self.build_email_content(contact, announce_context) |
|
|
|
|
content_html = content_html.format( |
|
|
|
|
**{ |
|
|
|
|
'name': name or contact.first_name or contact.last_name or _(u'Подписчик') |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
h = HTMLParser.HTMLParser() |
|
|
|
|
content_html = h.unescape(content_html) |
|
|
|
|
@ -392,7 +397,7 @@ class NewsLetterSender(object): |
|
|
|
|
title = self.newsletter.title2.format(**self.preheader_ctx) |
|
|
|
|
return title |
|
|
|
|
|
|
|
|
|
def build_email_content(self, contact, announce_context=None, name=None): |
|
|
|
|
def build_email_content(self, contact, announce_context=None): |
|
|
|
|
"""Generate the mail for a contact""" |
|
|
|
|
uidb36, token = tokenize(contact) |
|
|
|
|
context = Context({'contact': contact, |
|
|
|
|
@ -400,7 +405,6 @@ class NewsLetterSender(object): |
|
|
|
|
'newsletter': self.newsletter, |
|
|
|
|
'tracking_image_format': TRACKING_IMAGE_FORMAT, |
|
|
|
|
'uidb36': uidb36, 'token': token, |
|
|
|
|
'name': name or contact.first_name or contact.last_name or _(u'Подписчик'), |
|
|
|
|
'settings_links': self.settings_links, |
|
|
|
|
}) |
|
|
|
|
if self.announce: |
|
|
|
|
|