Notify the new user when they are accepted by some admin
Situation
In an open registration setup, if a person requests an account, this account is created and marked as disabled/inactive. Admins receive a notification, and can take some time to decide. If they delete the inactive (requested) account, or instead, enable the account, the person/group does not receive any notification welcoming them and telling them that they can already log in.
My problem
In the workflow we use in the gancio I participate in, we take some time to check if the email address corresponds to who they say, and such, and sometimes, people try to log in a couple of times before we accept them, and do not try further, even after we accepted them, because they don't know that something has changed. Sometimes we send them an email or contact them by other channels to tell them that they can already log in, but many times we don't, and people lose a bit the wish to join us and publish their stuff.
Wished feature
A notification is sent when a requested account is accepted.
Difficulty
If I understand correctly how it works currently, there is no difference in "accepting a new account" and re-enabling an existing account that was previously disabled. I mean, both situations are presented the same in the users admin tab, with the "active" column disabled. Therefore, I suspect that if we just send an email when activating an account, we may do it every time we reactivate it. This may not be an issue, but something to take into account at least when writing the template.
Admin screenshot
Affected files
I could find the file and to my surprise discovered that the feature is already implemented, but it's not working for the case I explained.
- https://framagit.org/les/gancio/-/blob/e4c78533671ec6c376ad1819187a8cc1127b35cb/server/api/controller/user.js#L71-L73
- https://framagit.org/les/gancio/-/tree/master/server/emails/confirm
Related cases
- A user is created directly by the admin (notification is sent)
- The user asks for recovery code (an email with the link is sent, but a final confirmation is not)
Possible solution
Is it possible that instead of the current
if (!user.is_active && req.body.is_active && user.recover_code) {
This should read
if (!user.is_active && req.body.is_active || user.recover_code) {
???