Skip to content

Commit

Permalink
Fix view in browser action
Browse files Browse the repository at this point in the history
* Previously injected twince into the TXT version
* Not aligned right no Gmail iOS
  • Loading branch information
codingjoe committed Feb 3, 2024
1 parent 840c376 commit 2b71787
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions emark/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from django.urls import reverse
from django.utils import translation
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import gettext

from emark import conf, utils

Expand Down Expand Up @@ -237,13 +235,7 @@ def get_body(self, html):
parser = utils.HTML2TextParser()
parser.feed(html)
parser.close()
body = str(parser)
if self.uuid:
href = reverse("emark:email-detail", kwargs={"pk": self.uuid})
href = parse.urljoin(self.get_site_url(), href)
txt = capfirst(gettext("view in browser"))
body = f"{txt} <{href}>\n\n" + body
return body
return str(parser)

def render(self, tracking_uuid=None):
"""Render the email."""
Expand Down
2 changes: 1 addition & 1 deletion emark/templates/emark/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{% if view_in_browser_url %}
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right">
<td align="right" class="align-right">
<small>
<a class="open-in-browser" href="{{ view_in_browser_url }}">{% trans 'view in browser'|capfirst %}</a>
</small>
Expand Down

0 comments on commit 2b71787

Please sign in to comment.