Update email_body.py

This commit is contained in:
Rushabh Mehta 2014-07-07 17:35:30 +05:30
parent e981a515dd
commit b08cf2bbf4

View file

@ -148,7 +148,7 @@ class EMail:
def add_pdf_attachment(self, name, html):
import pdfkit, os
fname = frappe.generate_hash() + ".pdf"
fname = os.path.join("/tmp", frappe.generate_hash() + ".pdf")
pdfkit.from_string(html, fname)
with open(fname, "rb") as fileobj:
self.add_attachment(name, fileobj.read(), 'application/octet-stream')