When i press invite as user button it sends two emails to receiver ?whys is that and how can i resolve this?
NCP
May 27, 2024, 8:21am
2
I tested it multiple times in the latest version 15. It just shows one message.
@NCP i am having this issue in both my local machine and development server . does it have some kind of issue with the way the email is set up ?
NCP
May 27, 2024, 9:02am
4
There is no problem in email account
@NCP i am now really confused on what could trigger this twice.
NCP
May 27, 2024, 9:14am
6
No idea, but check the code.
if new_password:
# new password given, no email required
_update_password(
user=self.name, pwd=new_password, logout_all_sessions=self.logout_all_sessions
)
if not self.flags.no_welcome_mail and cint(self.send_welcome_email):
self.send_welcome_mail_to_user()
self.flags.email_sent = 1
if frappe.session.user != "Guest":
msgprint(_("Welcome email sent"))
return
else:
self.email_new_password(new_password)
except frappe.OutgoingEmailError:
frappe.clear_last_message()
frappe.msgprint(
_("Please setup default outgoing Email Account from Settings > Email Account"), alert=True
)
# email server not set, don't send email
1 Like
@NCP on update they have called this send_password_notification() function and for some reason after the user is being created it is being edited somehow and triggering the email twice while it is created and after being edited.
@NCP
I am also facing the same issue ,
when ever I click on button Invite as User
, two time email has been triggered
First link is not use full, it will show the error as mentioned in attachment
Erpnext Version : 14.66
1 Like
NCP
July 29, 2024, 9:44am
9
Hi @Viral_Kansodiya ,
I raised the PR, so check it.
frappe:develop
← Nihantra-Patel:fix_email_twice_v15
opened 07:07AM - 29 Jul 24 UTC
version 15 and 14
fixes: #27226 & https://discuss.frappe.io/t/email-sent-twic… e-invite-as-user/124057/8?u=ncp
If the email has already been sent, will not resend it.
2 Likes
@NCP nice one man thanks. I saw it is in branch version-15 hot-fix . will it be added to version-15 branch ?
NCP
August 1, 2024, 10:10am
11
It will come after 1 week!
1 Like