Skip to content

Commit

Permalink
fix: broken link for email tracking pixels (#19030) (#19032)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6dda853)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Nov 28, 2022
1 parent ef5b7ae commit ca520e0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions frappe/email/doctype/email_queue/email_queue.py
Expand Up @@ -26,6 +26,7 @@
cstr,
get_hook_method,
get_string_between,
get_url,
nowdate,
sbool,
split_emails,
Expand Down Expand Up @@ -293,15 +294,11 @@ def build_message(self, recipient_email):
message = self.include_attachments(message)
return message

def get_tracker_str(self):
tracker_url_html = '<img src="https://{}/api/method/frappe.core.doctype.communication.email.mark_email_as_seen?name={}"/>'

message = ""
def get_tracker_str(self) -> str:
if frappe.conf.use_ssl and self.email_account_doc.track_email_status:
message = quopri.encodestring(
tracker_url_html.format(frappe.local.site, self.queue_doc.communication).encode()
).decode()
return message
tracker_url_html = f'<img src="{get_url()}/api/method/frappe.core.doctype.communication.email.mark_email_as_seen?name={self.queue_doc.communication}"/>'
return quopri.encodestring(tracker_url_html.encode()).decode()
return ""

def get_unsubscribe_str(self, recipient_email: str) -> str:
unsubscribe_url = ""
Expand Down

0 comments on commit ca520e0

Please sign in to comment.