Customization of Registration Approval Email

Hello,
Can the system generated password be used for User signup for the first time in ERPNext?
To do so, how can I customize the Registration Email? Anybody know where that code is placed?

@Amalendu

Yes, the system does send an email when a new user is registered.

As far as customization is concern the code is written in:

frappe-bench/apps/frappe/frappe/templates/email/new_user.html

<h3>{{ title }}</h3>
<p>{{_("Dear")}} {{ first_name }}{% if last_name %} {{ last_name}}{% endif %},</p>
<p>{{_("A new account has been created for you at {0}").format(site_url)}}.</p>
<p>{{_("Your login id is")}}: <b>{{ user }}</b>
<p>{{_("Click on the link below to complete your registration and set a new password")}}.</p>
<p><b><a href="{{ link }}">{{_("Complete Registration")}}</a></b></p>
<br>
<p>{{_("Thank you")}},<br>
{{ user_fullname }}</p>

<br>
<p style="font-size: 85%;">{{_("You can also copy-paste this link in your browser")}} <a href="{{ link }}">{{ link }}</a></p>

@ruchin78 Thank you…

Thanks for sharing this.

but if I make the changes in this file it will get overwritten once the bench get updated!
Can I put my new Template in my App and call it by hooks?
If is it possiple How I can do that?

@Mohammed_Redha
Yes, it is possible to do via hooks.

Regards
Ruchin Sharma

@ruchin78 thanks for your reply.
Could you tell me how?

Hi @Mohammed_Redha
I really don’t know the exact answer of this question but can tell you at some extent.

Write a code in hooks.py
For example:

doc_events = {
  'BOM': {
    'onload': ['library.folder_scriptss.get_bom_detail'],
    'before_save': ['library.folder_scriptss.del_bom_detail'],
    'before_submit': ['library.folder_scriptss.del_bom_detail']
  },

The fight here is I don’t know exactly which even will be used and on which doctype.

And then you can write your html code in your PY. In this case file will be

frappe-bench/library/library/folder_scriptss/get_bom_details.py

Regards
Ruchin Sharma