Cannot email New POS Invoice

Hello,
I am unable to email new POS Invoice Receipt after I Complete Order;
When I click on “Email Receipt” it offers me the option to provide the email address.
After I input the email address and I click Send it shows a notification “Email Sent Successfully.” But the email is not sent. When I look at the error logs two new errors are generated as shown below:
one error says “frappe.core.doctype.communication.email.sendmail”
and the other is show in the screenshot below

my installation is as follows:
erpnext 13.9.2
frappe 13.9.1

I can send other types of emails from within erpnext meaning my Email Domain (gmail) and Email Setups are working.

Please help, thank you in advance.

1 Like

Same Issue

@wachiranicholus & @Sagar_Garg

If you have access to the source code of frappe, then go to frappe > core > doctype > communication and open email.py then go to line number 227 and replace:

doc.content += get_attach_link(doc, print_format)

with:

attach_link = get_attach_link(doc, print_format)
if isinstance(attach_link, str):
    doc.content += attach_link

hello, I tried this but not working.

@a1008 If it didn’t work, then try this…

attach_link = get_attach_link(doc, print_format)
if isinstance(attach_link, str):
    doc.content = (doc.content if isinstance(doc.content, str) else "") + attach_link