Delete My Account is a Open Source Joomla! plugin, which can give an option to your site members, through which they can delete their account. Obviously, there is an option for admin that user' account should be delete of blocked, once user deletes his/her account. If user deletes his/her account, then an email will be sent to all the Admin users that "An user has deleted his account". What you have to do is,
<a href="#" class="f90-delete-my-account">Delete my account</a>
But make sure the link is visible to only registered users and do not try this for admin users.
Giving your user the access to delete their account, is possible in Joomla! now. Its not core part of Joomla! but we have created a plug-in, which will do it without affecting your website. Here are the some simple steps, through which you can get this functionality working.
Install the plugin from Extension Manager of your Joomla! website. After installing the plugin will be listed in plugin manager section as "Delete My Account". It is a system plugin, so you can also filter the listing by type "System". Enable the plugin and edit the plugin to set Parameters.
After clicking on edit link of plugin you will have some options, which you should configure according to your need.
After configuring the plugin, you need to create link. This link can be shown anywhere, like it can be a menu link, any module or your custom content can have a anchor tag with href="#". For creating menu link you must take care of two things
Your admin configuration is complete now. You need to test the plugin now. Create a dummy account and loin with this account at front end. You will see delete my account link, click on it. After clicking this link you will see an Confirmation Box, asking that "Are you sure you want to delete your account". after confirmation an Ajax request will be sent to the plugin and your request will be processed. You should wait util it get completed.
After processing you will have the acknowledgement box saying, your account have been delete successfully and will make you logout from your current session. If any error occurs, then error messgae will be shown and your account will not get deleted.
All the admin users, who can receive system email will receive an Email whenever any user requests for deleting his/her account. You can change the mail content and other text by overriding language tokens. It is described in next paragraph.
You can change the text of html which is displayed to user and email which is sent to ammin user, by overriding language token of this plugin. Find the text which you want to change in file YourJoomla => administrator => language => en-GB => en-Gb.plg_system_f990deletemyaccount.ini and override the respective token(s).