I recenty updated to the latest version of frappe and everything else works fine, but my custom server side email script which used to work fine doesn’t work after the update.
Here is the error that I am getting:
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 56, in application
response = frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 922, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/egov_af/egov_af/api.py", line 23, in send_notification_emails
reference_name=meeting.name
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 432, in sendmail
inline_images=inline_images, header=header)
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py", line 104, in send
unsubscribe_link=unsubscribe_link)
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/email_body.py", line 256, in get_formatted_html
html = inline_style_in_html(html)
File "/home/frappe/frappe-bench/apps/frappe/frappe/email/email_body.py", line 272, in inline_style_in_html
from premailer import Premailer
ImportError: No module named premailer```
I installed premailer too using `pip install premailer` but the error still appears.
Here is my server side script in api.py:
def send_notification_emails(meeting):
meeting = frappe.get_doc("Meeting", meeting)
meeting.check_permission("email")
frappe.sendmail(
recipients=[p.email for p in meeting.participants],
subject=meeting.subject,
sender=frappe.session.user,
message=meeting.message,
reference_doctype=meeting.doctype,
reference_name=meeting.name
)
meeting.add_comment("Comment", meeting.status + ": email sent to meeting participants.")
frappe.msgprint(_("Notification emails sent to all the participants."))