Skip to content
Browse files

minor refactoring

  • Loading branch information...
1 parent f09dfb3 commit 43eca4469fcf29187ffd01afa5241796c0d05c68 @sherzberg sherzberg committed Aug 10, 2011
Showing with 13 additions and 4 deletions.
  1. +12 −3 emailer/models.py
  2. +1 −1 emailer/utils/__init__.py
View
15 emailer/models.py
@@ -243,17 +243,26 @@ def _add_tracking_info(self, html):
return tracking_html
+ def _convert_relative_urls(self, html):
+ return html
+
+ def _prepare_html(self):
+ html = _apply_merge_data(self.html, self.merge_data)
+ html = self._convert_relative_urls(html)
+
+ return html
+
def _build_message(self):
blast = self.email_blast
subject = blast.subject
from_email = blast.from_address
to = self.to_address
- merged_html = _apply_merge_data(self.html, self.merge_data)
+ fixed_html = self._prepare_html()
- text_content = html2text(merged_html)
- html_content = self._add_tracking_info(merged_html)
+ text_content = html2text(fixed_html)
+ html_content = self._add_tracking_info(fixed_html)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
View
2 emailer/utils/__init__.py
@@ -62,4 +62,4 @@ def send_siteusers_email(user_objs, from_address, subject, content_html, just_pr
else:
status = email_blast.send_now()
- return status
+ return status

0 comments on commit 43eca44

Please sign in to comment.
Something went wrong with that request. Please try again.