Welcome Email No Longer Being Sent on User Creation

Welcome emails are no longer being sent on new user creation. I tried to create user from the Employee Human Resources and Users and Permissions Module and in both cases welcome email was not sent on user creation. This is a new issue. Can it be looked at?

2 Likes

Do you have an E-Mailaccount set up for the matter?

Yes. All other email notifications work as intended except for new user email notification

I just also tested that and can confirm that the welcome Message isn’t sent. Password reset for example works though.

Is this issue getting a look into???

I’ve noticed the same thing - user welcome e-mail not being sent. Other e-mails are though.

@flexy2ky, @Ryan_Bohm

This PR should fix the issue.

1 Like

@surajshetty Update pulled but issue still not fixed.

@surajshetty when will this be merged to Version 12? New users still do not receive welcome email.

@surajshetty Okay this issue seems to vhave been resolved with v12.5.0 but now email alert won’t trigger on workflow transition. I have checked everything and no change has been made since friday when i upgraded to v12.5.0

@flexy2ky Can you confirm if you have conditions in your workflow transition?
Those condition should be satisfied for you to receive email alert.

A bug was fixed recently. Previously, conditions were not considered for sending email alerts.

@surajshetty I don’t have any conditions set in my workflow. Initially I did but the conditions weren’t working as expected because the approvers with the right roles would receive mails regardless of the conditions as well as the big you have now fixed so I implemented a workaround which is messy but at least gives me some results.

When I noticed this issue I set up a demo instance with fresh data and set up a sample workflow to test if this issue was the setup in my production instance. I was able to replicate the issue as email alerts were not being generated for workflow transitions. I tested email alert for new user creation, password reset, backup notification as well as custom notification for doc status change and they all worked as expected.

@flexy2ky Can you share your workflow configuration. Need that to debug the issue.

@surajshetty This is a simple purchase order workflow set up in my test instance


This is the test purchase order approved

Yet i have only one email in queue for password reset:

@surajshetty Any progress on finding why this has happened? In the alternative, can you point me to how i can configure email alert to include workflow action? This bug has crippled major operations for me as approvals are now delayed due to non-notification and the extra steps required to approve is burdensome.

I could live with the old issue of users not receiving welcome notification as the issue was one-off, but this one strikes at the heart of business operations for me so i am pretty desperate.

@surajshetty I continued investigations and found this in my failed background jobs report:

failed
<function send_workflow_action_email at 0x7f77f401a510>

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/worker.py”, line 793, in perform_job
rv = job.perform()
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 599, in perform
self._result = self._execute()
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 605, in _execute
return self.func(*self.args, **self.kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 99, in execute_job
method(**kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/workflow/doctype/workflow_action/workflow_action.py”, line 210, in send_workflow_action_email
enqueue(method=frappe.sendmail, queue=‘short’, **email_args)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 69, in enqueue
kwargs=queue_args)
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/queue.py”, line 258, in enqueue_call
job = self.enqueue_job(job, at_front=at_front)
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/queue.py”, line 324, in enqueue_job
job.save(pipeline=pipe)
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 516, in save
connection.hmset(key, self.to_dict(include_meta=include_meta))
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 469, in to_dict
obj[‘data’] = zlib.compress(self.data)
File “/home/ubuntu/frappe-bench/env/lib/python3.6/site-packages/rq/job.py”, line 234, in data
self._data = dumps(job_tuple)
TypeError: can’t pickle dict_values objects

This is consistent everytime a workflow action is created. I then restored by backup on a test machine with ERPNext v12.4.3 and Frappe v12.2.1 and tested the workflow again and it worked as expected. This shows definitively that v12.5.0 update broke something. I am going to try to focus on what broke and will post here if i find anything.

@surajshetty So as it turns out, i had a mothballed test instance with v12.4.3 and i booted it up and extracted the workflow_action.py. I renamed the one on my production server .bak and copied the extracted file to my production server and now workflow action email alert works again. It proves this bug fix definitely broke workflow action email alert. I am not a developer unfortunately and my knowledge of code is severely limited so i can’t troubleshoot the reason for the fix breaking the email alert. If you look at the code again and refine it i believe it can be fixed.

@flexy2ky This PR should fix the issue

1 Like

yes, this has been fixed in a recent version.