How to prevent sending welcome email while posting user using rest api from postman

Hello team, I just register User using rest api from postman-
End Point- http://127.0.0.1:8000/api/resource/User/
Body - {
email":"api8@gmail.com”,
“first_name”:“api3first”,
“last_name”:“api3last”,
“mobile_no”:“0753811543”
}

User is posted successfully but with welcome email error.
I got the error message as below:
{
“exc_type”: “ValidationError”,
“exc”: “["Traceback (most recent call last):\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 330, in evaluate_alert\n alert.send(doc)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 124, in send\n self.send_an_email(doc, context)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 171, in send_an_email\n and attachments[0].get(‘print_letterhead’)) or False))\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 487, in sendmail\n inline_images=inline_images, header=header, print_letterhead=print_letterhead)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/queue.py\", line 76, in send\n email_account = get_outgoing_email_account(True, append_to=reference_doctype, sender=sender)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/smtp.py\", line 86, in get_outgoing_email_account\n frappe.OutgoingEmailError)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 376, in throw\n msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 355, in msgprint\n _raise_exception()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 315, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.OutgoingEmailError: Please setup default Email Account from Setup > Email > Email Account\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/app.py\", line 64, in application\n response = frappe.api.handle()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/api.py\", line 130, in handle\n \"data\": frappe.get_doc(data).insert().as_dict()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 254, in insert\n self.run_method(\"after_insert\")\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 799, in run_method\n self.run_notifications(method)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 848, in run_notifications\n _evaluate_alert(alert)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 831, in _evaluate_alert\n evaluate_alert(self, alert.name, alert.event)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 336, in evaluate_alert\n frappe.utils.get_link_to_form(‘Error Log’, error_log.name))))\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 376, in throw\n msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 355, in msgprint\n _raise_exception()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 315, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.ValidationError: Error in Notification: <a href=\"http://127.0.0.1:8000/desk#Form/Error%20Log/9517657ab2\\\“>9517657ab2</a>\\n\”]”,
“_server_messages”: “["{\"message\": \"Please setup default Email Account from Setup > Email > Email Account\", \"indicator\": \"red\", \"raise_exception\": 1}", "{\"message\": \"Error in Notification: <a href=\\\"http://127.0.0.1:8000/desk#Form/Error%20Log/9517657ab2\\\\\\\“>9517657ab2</a>\\\”, \"indicator\": \"red\", \"raise_exception\": 1}"]”

Can any one please tell me how to prevent sending welcome email.

Thanks

Pass this parameter in body

“send_welcome_email”:0

Hi Thanks for reply, I’ve already did that but no luck
{
email":"api6@gmail.com”,
“first_name”:“api4first”,
“last_name”:“api4last”,
“mobile_no”:“5754211593”,
“send_welcome_email”:0
}

it’s working for me.

share your error response

{
“exc_type”: “ValidationError”,
“exc”: “["Traceback (most recent call last):\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 329, in evaluate_alert\n alert.send(doc)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 123, in send\n self.send_an_email(doc, context)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 170, in send_an_email\n and attachments[0].get(‘print_letterhead’)) or False))\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 487, in sendmail\n inline_images=inline_images, header=header, print_letterhead=print_letterhead)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/queue.py\", line 76, in send\n email_account = get_outgoing_email_account(True, append_to=reference_doctype, sender=sender)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/smtp.py\", line 86, in get_outgoing_email_account\n frappe.OutgoingEmailError)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 376, in throw\n msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 355, in msgprint\n _raise_exception()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 315, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.OutgoingEmailError: Please setup default Email Account from Setup > Email > Email Account\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/app.py\", line 64, in application\n response = frappe.api.handle()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/api.py\", line 130, in handle\n \"data\": frappe.get_doc(data).insert().as_dict()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 254, in insert\n self.run_method(\"after_insert\")\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 799, in run_method\n self.run_notifications(method)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 848, in run_notifications\n _evaluate_alert(alert)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/model/document.py\", line 831, in _evaluate_alert\n evaluate_alert(self, alert.name, alert.event)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py\", line 335, in evaluate_alert\n frappe.utils.get_link_to_form(‘Error Log’, error_log.name))))\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 376, in throw\n msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 355, in msgprint\n _raise_exception()\n File \"/home/shantanu/frappe_test/frappe-bench/apps/frappe/frappe/init.py\", line 315, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.ValidationError: Error in Notification: <a href=\"http://127.0.0.1:8000/desk#Form/Error%20Log/520c88a4b0\\\“>520c88a4b0</a>\\n\”]”,
“_server_messages”: “["{\"message\": \"Please setup default Email Account from Setup > Email > Email Account\", \"indicator\": \"red\", \"raise_exception\": 1}", "{\"message\": \"Error in Notification: <a href=\\\"http://127.0.0.1:8000/desk#Form/Error%20Log/520c88a4b0\\\\\\\“>520c88a4b0</a>\\\”, \"indicator\": \"red\", \"raise_exception\": 1}"]”
}strong text