How to send email on workflow

the email is not getting triggered
Send email alerts is checked

Recently we tested for that, so it’s worked properly in v15.

If older v15, then upgrade it. because the issue has been already resolved.

image
this is the version what i have

Again check the configuration and try it. when changing the workflow state then email will trigger around in 60 sec.


error log
Do i need to upgrade to newer version

Please share the full error log.

Title
frappe.workflow.doctype.workflow_action.workflow_action.send_workflow_action_email
method
Error
Traceback with variables (most recent call last):
  File "apps/frappe/frappe/utils/background_jobs.py", line 220, in execute_job
    retval = method(**kwargs)
      site = 'default'
      method = <function send_workflow_action_email at 0x7f5e9658e0e0>
      event = None
      job_name = 'frappe.workflow.doctype.workflow_action.workflow_action.send_workflow_action_email'
      kwargs = {'doc': <SalesOrder: SO24C25/I/00047>, 'transitions': [{'allowed': 'Managment', 'action': 'Proceed to Billing', 'state': 'Pending Approval from Production Manager', 'allow_self_approval': 1, 'next_state': 'Approved', 'condition': None}, {'allowed': 'Prod Manager', 'action': 'Proceed to Billing', 'state': 'Pending Approval from Production Manager', 'allow_self_approval': 1, 'next_state': 'Approved', 'condition': None}]}
      user = 'Administrator'
      is_async = True
      retry = 0
      retval = None
      method_name = 'frappe.workflow.doctype.workflow_action.workflow_action.send_workflow_action_email'
      before_job_task = 'frappe.monitor.start'
  File "apps/frappe/frappe/workflow/doctype/workflow_action/workflow_action.py", line 381, in send_workflow_action_email
    common_args = get_common_email_args(doc)
      doc = <SalesOrder: SO24C25/I/00047>
      transitions = [{'allowed': 'Managment', 'action': 'Proceed to Billing', 'state': 'Pending Approval from Production Manager', 'allow_self_approval': 1, 'next_state': 'Approved', 'condition': None}, {'allowed': 'Prod Manager', 'action': 'Proceed to Billing', 'state': 'Pending Approval from Production Manager', 'allow_self_approval': 1, 'next_state': 'Approved', 'condition': None}]
      users_data = {}
  File "apps/frappe/frappe/workflow/doctype/workflow_action/workflow_action.py", line 482, in get_common_email_args
    "attachments": [frappe.attach_print(doctype, docname, file_name=docname, doc=doc)],
      doc = <SalesOrder: SO24C25/I/00047>
      doctype = 'Sales Order'
      docname = 'SO24C25/I/00047'
      email_template = <EmailTemplate: Sales Order Workflow Mail>
      subject = 'Please Approve the sales order for Work flow'
      response = '<div class="ql-editor read-mode"><table class="table table-bordered"><tbody><tr><td data-row="insert-column-right">hI </td><td data-row="insert-column-right"><br></td><td data-row="insert-column-right" class="ql-indent-2"><br></td><td data-row="insert-column-right"><br></td></tr><tr><td data-row="delete-column"><br></td><td data-row="delete-column"><br></td><td data-row="delete-column"><br></td><td data-row="delete-column"><br></td></tr><tr><td data-row="insert-column-right"><br></td><td data-row="insert-column-right"><br></td><td data-row="insert-column-right"><br></td><td data-row="insert-column-right"><br></td></tr><tr><td data-row="row-lkhc"><br></td><td data-row="row-lkhc"><br></td><td data-row="row-lkhc"><br></td><td data-row="row-lkhc"><br></td></tr><tr><td data-row="row-9zyu"><br></td><td data-row="row-9zyu"><br></td><td data-row="row-9zyu"><br></td><td data-row="row-9zyu"><br></td></tr><tr><td data-row="insert-table"><br></td><td data-row="insert-table"><br></td><td data-row=...
  File "apps/frappe/frappe/__init__.py", line 2175, in attach_print
    else get_print(doctype, name, **kwargs)
      doctype = 'Sales Order'
      name = 'SO24C25/I/00047'
      file_name = 'SO24C25/I/00047'
      print_format = None
      style = None
      html = None
      doc = <SalesOrder: SO24C25/I/00047>
      lang = None
      print_letterhead = True
      password = ********
      letterhead = None
      print_language = <function print_language at 0x7f5e95c7cc10>
      scrub_urls = <function scrub_urls at 0x7f5e9973f640>
      get_pdf = <function get_pdf at 0x7f5e94a11510>
      print_settings = {'add_draft_heading': '1', 'allow_page_break_inside_tables': '0', 'allow_print_for_cancelled': '0', 'allow_print_for_draft': '1', 'creation': None, 'docstatus': '0', 'enable_print_server': '0', 'enable_raw_printing': '0', 'font': 'Default', 'font_size': '0', 'idx': '0', 'modified': '2023-10-13 14:06:08.999225', 'modified_by': 'Administrator', 'name': 'Print Settings', 'owner': 'Administrator', 'pdf_page_height': '0', 'pdf_page_size': 'A4', 'pdf_page_width': '0', 'print_style': 'Redesign', 'repeat_header_footer': '1', 'send_print_as_pdf': '1', 'with_letterhead': '1'}
      kwargs = {'print_format': None, 'style': None, 'doc': <SalesOrder: SO24C25/I/00047>, 'no_letterhead': False, 'letterhead': None, 'password': '********', 'as_pdf': True}
      content = ''
      ext = '.pdf'
  File "apps/frappe/frappe/__init__.py", line 2134, in get_print
    return get_pdf(html, options=pdf_options, output=output) if as_pdf else html
      doctype = 'Sales Order'
      name = 'SO24C25/I/00047'
      print_format = None
      style = None
      as_pdf = True
      doc = <SalesOrder: SO24C25/I/00047>
      output = None
      no_letterhead = False
      password = ********
      pdf_options = {}
      letterhead = None
      get_pdf = <function get_pdf at 0x7f5e94a11510>
      get_response_without_exception_handling = <function get_response_without_exception_handling at 0x7f5e9566c8b0>
      original_form_dict = {}
      response = <Response 25658 bytes [200 OK]>
      html = '<!DOCTYPE html>\n<html lang="en" dir="ltr">\n<head>\n\t<meta charset="utf-8">\n\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\n\t<title>SIL - DIVINE TECHNOLOGIES</title>\n\t<meta name="generator" content="frappe">\n\t<link type="text/css" rel="stylesheet" href="/assets/frappe/dist/css/print.bundle.DBV6R6TI.css">\n\t\n\t\t<style>\n\t\t@media screen {\n\t.print-format-gutter {\n\t\tbackground-color: #d1d8dd;\n\t\tpadding: 30px 0px;\n\t}\n\t.print-format {\n\t\tbackground-color: white;\n\t\tborder-radius: 8px;\n\t\tmax-width: 8.3in;\n\t\tmin-height: 11.69in;\n\t\tpadding: 0.75in;\n\t\tmargin: auto;\n\t\tcolor: var(--gray-900);\n\t}\n\n\t.print-format.landscape {\n\t\tmax-width: 11.69in;\n\t\tpadding: 0.2in;\n\t}\n\n\t.page-break {\n\t\t/* padding: 15px 0px; */\n\t\tborder-bottom: 1px dashed #888;\n\t}\n\n\t/* .page-break:first-child {\n\t\tpadding-top: 0px;\n\t} */\n\n\t.page-break:last-child {\n\t\tborder-bottom: 0px;\n\t}\n\n\t/* mozilla hack for images in tab...
  File "apps/frappe/frappe/utils/pdf.py", line 89, in get_pdf
    filedata = pdfkit.from_string(html, options=options or {}, verbose=True)
      html = '<!DOCTYPE html>\n\n<html dir="ltr" lang="en"><head>\n<meta charset="utf-8"/>\n<meta content="width=device-width, initial-scale=1.0" name="viewport"/>\n<title>SIL - DIVINE TECHNOLOGIES</title>\n<meta content="frappe" name="generator"/>\n<link href="http://default/assets/frappe/dist/css/print.bundle.DBV6R6TI.css" rel="stylesheet" type="text/css"/>\n<style>\n\t\t@media screen {\n\t.print-format-gutter {\n\t\tbackground-color: #d1d8dd;\n\t\tpadding: 30px 0px;\n\t}\n\t.print-format {\n\t\tbackground-color: white;\n\t\tborder-radius: 8px;\n\t\tmax-width: 8.3in;\n\t\tmin-height: 11.69in;\n\t\tpadding: 0.75in;\n\t\tmargin: auto;\n\t\tcolor: var(--gray-900);\n\t}\n\n\t.print-format.landscape {\n\t\tmax-width: 11.69in;\n\t\tpadding: 0.2in;\n\t}\n\n\t.page-break {\n\t\t/* padding: 15px 0px; */\n\t\tborder-bottom: 1px dashed #888;\n\t}\n\n\t/* .page-break:first-child {\n\t\tpadding-top: 0px;\n\t} */\n\n\t.page-break:last-child {\n\t\tborder-bottom: 0px;\n\t}\n\n\t/* mozilla hack for images in tab...
      options = {'print-media-type': None, 'background': None, 'images': None, 'quiet': None, 'encoding': 'UTF-8', 'margin-right': '15mm', 'margin-left': '15mm', 'header-html': '/tmp/frappe-pdf-0cc1c5239ab08d2e3b5d1201261a0cded3f7db74f029b579c7320d6a.html', 'footer-html': '/tmp/frappe-pdf-466de81f1453fadfc9b0d21dc7d7d9231e556de0a7cc5f3b1b23d8f3.html', 'page-size': 'A4', 'disable-javascript': '', 'disable-local-file-access': '', 'disable-smart-shrinking': ''}
      output = None
      filedata = ''
  File "env/lib/python3.10/site-packages/pdfkit/api.py", line 75, in from_string
    return r.to_pdf(output_path)
      input = '<!DOCTYPE html>\n\n<html dir="ltr" lang="en"><head>\n<meta charset="utf-8"/>\n<meta content="width=device-width, initial-scale=1.0" name="viewport"/>\n<title>SIL - DIVINE TECHNOLOGIES</title>\n<meta content="frappe" name="generator"/>\n<link href="http://default/assets/frappe/dist/css/print.bundle.DBV6R6TI.css" rel="stylesheet" type="text/css"/>\n<style>\n\t\t@media screen {\n\t.print-format-gutter {\n\t\tbackground-color: #d1d8dd;\n\t\tpadding: 30px 0px;\n\t}\n\t.print-format {\n\t\tbackground-color: white;\n\t\tborder-radius: 8px;\n\t\tmax-width: 8.3in;\n\t\tmin-height: 11.69in;\n\t\tpadding: 0.75in;\n\t\tmargin: auto;\n\t\tcolor: var(--gray-900);\n\t}\n\n\t.print-format.landscape {\n\t\tmax-width: 11.69in;\n\t\tpadding: 0.2in;\n\t}\n\n\t.page-break {\n\t\t/* padding: 15px 0px; */\n\t\tborder-bottom: 1px dashed #888;\n\t}\n\n\t/* .page-break:first-child {\n\t\tpadding-top: 0px;\n\t} */\n\n\t.page-break:last-child {\n\t\tborder-bottom: 0px;\n\t}\n\n\t/* mozilla hack for images in tab...
      output_path = None
      options = {'print-media-type': None, 'background': None, 'images': None, 'quiet': None, 'encoding': 'UTF-8', 'margin-right': '15mm', 'margin-left': '15mm', 'header-html': '/tmp/frappe-pdf-0cc1c5239ab08d2e3b5d1201261a0cded3f7db74f029b579c7320d6a.html', 'footer-html': '/tmp/frappe-pdf-466de81f1453fadfc9b0d21dc7d7d9231e556de0a7cc5f3b1b23d8f3.html', 'page-size': 'A4', 'disable-javascript': '', 'disable-local-file-access': '', 'disable-smart-shrinking': ''}
      toc = None
      cover = None
      css = None
      configuration = None
      cover_first = False
      verbose = True
      r = <pdfkit.pdfkit.PDFKit object at 0x7f5e9466db40>
  File "env/lib/python3.10/site-packages/pdfkit/pdfkit.py", line 201, in to_pdf
    self.handle_error(exit_code, stderr)
      self = <pdfkit.pdfkit.PDFKit object at 0x7f5e9466db40>
      path = None
      args = ['/usr/local/bin/wkhtmltopdf', '--print-media-type', '--background', '--images', '--quiet', '--encoding', 'UTF-8', '--margin-right', '15mm', '--margin-left', '15mm', '--header-html', '/tmp/frappe-pdf-0cc1c5239ab08d2e3b5d1201261a0cded3f7db74f029b579c7320d6a.html', '--footer-html', '/tmp/frappe-pdf-466de81f1453fadfc9b0d21dc7d7d9231e556de0a7cc5f3b1b23d8f3.html', '--page-size', 'A4', '--disable-javascript', '--disable-local-file-access', '--disable-smart-shrinking', '-', '-']
      result = <Popen: returncode: 1 args: ['/usr/local/bin/wkhtmltopdf', '--print-media-ty...>
      input = b'<!DOCTYPE html>\n\n<html dir="ltr" lang="en"><head>\n<meta charset="utf-8"/>\n<meta content="width=device-width, initial-scale=1.0" name="viewport"/>\n<title>SIL - DIVINE TECHNOLOGIES</title>\n<meta content="frappe" name="generator"/>\n<link href="http://default/assets/frappe/dist/css/print.bundle.DBV6R6TI.css" rel="stylesheet" type="text/css"/>\n<style>\n\t\t@media screen {\n\t.print-format-gutter {\n\t\tbackground-color: #d1d8dd;\n\t\tpadding: 30px 0px;\n\t}\n\t.print-format {\n\t\tbackground-color: white;\n\t\tborder-radius: 8px;\n\t\tmax-width: 8.3in;\n\t\tmin-height: 11.69in;\n\t\tpadding: 0.75in;\n\t\tmargin: auto;\n\t\tcolor: var(--gray-900);\n\t}\n\n\t.print-format.landscape {\n\t\tmax-width: 11.69in;\n\t\tpadding: 0.2in;\n\t}\n\n\t.page-break {\n\t\t/* padding: 15px 0px; */\n\t\tborder-bottom: 1px dashed #888;\n\t}\n\n\t/* .page-break:first-child {\n\t\tpadding-top: 0px;\n\t} */\n\n\t.page-break:last-child {\n\t\tborder-bottom: 0px;\n\t}\n\n\t/* mozilla hack for images in ta...
      stdout = b'%PDF-1.4\n1 0 obj\n<<\n/Title (\xfe\xff\x00S\x00I\x00L\x00 \x00-\x00 \x00D\x00I\x00V\x00I\x00N\x00E\x00 \x00T\x00E\x00C\x00H\x00N\x00O\x00L\x00O\x00G\x00I\x00E\x00S)\n/Creator (\xfe\xff\x00w\x00k\x00h\x00t\x00m\x00l\x00t\x00o\x00p\x00d\x00f\x00 \x000\x00.\x001\x002\x00.\x006)\n/Producer (\xfe\xff\x00Q\x00t\x00 \x004\x00.\x008\x00.\x007)\n/CreationDate (D:20240416055857Z)\n>>\nendobj\n3 0 obj\n<<\n/Type /ExtGState\n/SA true\n/SM 0.02\n/ca 1.0\n/CA 1.0\n/AIS false\n/SMask /None>>\nendobj\n4 0 obj\n[/Pattern /DeviceRGB]\nendobj\n8 0 obj\n<<\n/Type /Annot\n/Subtype /Link\n/Rect [80.2500000  677  129  691.250000 ]\n/Border [0 0 0]\n/A <<\n/Type /Action\n/S /URI\n/URI (http://default/api/method/frappe.utils.print_format.download_pdf?doctype=Sales%20Order&name=SO24C25/I/00047&key=None)\n>>\n>>\nendobj\n5 0 obj\n<<\n/Type /Page\n/Parent 2 0 R\n/Contents 9 0 R\n/Resources 11 0 R\n/Annots 12 0 R\n/MediaBox [0 0 595 842]\n>>\nendobj\n11 0 obj\n<<\n/ColorSpace <<\n/PCSp 4 0 R\n/CSp /DeviceRGB\n/...
      stderr = 'Exit with code 1 due to network error: HostNotFoundError\n'
      exit_code = 1
  File "env/lib/python3.10/site-packages/pdfkit/pdfkit.py", line 155, in handle_error
    raise IOError('wkhtmltopdf reported an error:\n' + stderr)
      exit_code = 1
      stderr = 'Exit with code 1 due to network error: HostNotFoundError\n'
      stderr_lines = ['Exit with code 1 due to network error: HostNotFoundError']
builtins.OSError: wkhtmltopdf reported an error:
Exit with code 1 due to network error: HostNotFoundError

error message indicates that there was a problem with generating a PDF file using wkhtmltopdf.

please install the correct / latest version of wkhtmltopdf with qt patched

https://wkhtmltopdf.org/downloads.html

@NCP
image
this is the version we already installed

It is currently 12.6 with patches. Which new version do you need to install? Can you tell us how to trigger your error?

This is what our providers ask to us?
Do we need to install?

It is solved?