rob-luke / emails-html-to-pdf

Convert emails without attachments to pdf and send as email
32 stars 7 forks source link

Errorhandling of Tracking Pixels #11

Closed mirisbowring closed 2 years ago

mirisbowring commented 2 years ago

I've found another edge case:

I started converting my PayPal EMails to PDFs to import them to paperless. for most of them i get the HostNotFoundError. This relates to the tracking pixel in their mails.

How did I fix this?:

  1. append 127.0.0.1 tracking.paypal.com to /etc/hosts
  2. pass pdfkit options to pdfkit.from_string:
    options = {
    'load-media-error-handling': 'ignore'
    }
    pdfkit.from_string(pdftext, filename, options=options)
smseidl commented 2 years ago

This is the same issue I was having. Has the most recent release fixed it for you?

mirisbowring commented 2 years ago

@smseidl I pulled the latest image today which did not solve the problem, which is why i created #12 :)