Skip to content

Notification email on admin registration approval#20282

Closed
carlitorweb wants to merge 32 commits intojoomla:stagingfrom
carlitorweb:email_admin_registration
Closed

Notification email on admin registration approval#20282
carlitorweb wants to merge 32 commits intojoomla:stagingfrom
carlitorweb:email_admin_registration

Conversation

@carlitorweb
Copy link
Member

@carlitorweb carlitorweb commented May 2, 2018

Pull Request for Issue #13620

Summary of Changes

Sending a notification email, after an Admin activate a user/users, on the user's list of com_users

Testing Instructions

  • Register as a new user
  • Go to the Users list inside the administration, and activate the user/users
  • Check the email is sent to the user, notifying him that it has been approved on the site

  • Edit a user that is not activated
  • Press the button you will find under the Account Details tab
  • Check the user is activated and an email is sent for notifying him that it has been approved on the site

  • Edit a user that is activated, but that has not yet entered in the site for the first time
  • Check the same button is there under the Account Details tab, and press it
  • Check an email is sent for notifying him that it has been approved on the site

Expected result

An email is sent to the user, notifying him that it has been approved on the site

Actual result

The user is activated but is not notified of this change

Request for feedback (SOLVED)

This change also requires that within the user edit view, a button appears that allows an administrator to activate the user from there.

For this, I added a new radio field "activation" for handle this under Accounts Details, but this field store a hash when the user It is registered in the site then this new field is not convenient.
new field - edit view

I can create a new field under the params fields, and handle this as a param, but I not think this need be under the Basic Settings tab.

So, my doubt is, What is the best way to treat this?

Documentation Changes Required

  • New com_users.user button added.
  • Now when you activate a user on com_users list, send an email

@brianteeman
Copy link
Contributor

why not a simple button that "activates" the user and "sends the email" - something like here (ignore the extra tabs)

chrome_2018-05-02_14-27-42

@carlitorweb
Copy link
Member Author

That is a good point @brianteeman . Thank you. I will work on that way.

@brianteeman
Copy link
Contributor

@carlitorweb you might find the second half of this blog post (and the comments) useful https://brian.teeman.net/joomla/870-authorising-and-approving-joomla-users

Thanks for working on this

@carlitorweb
Copy link
Member Author

Really have good comments that blog post. Carlos found an easy and good way for this https://github.com/carcam/plg_user_sendactivationmail/blob/master/sendactivation/sendactivationmail.php .
But that comment about map this button with both actions, "activation" AND "resend email sound good too.

@carlitorweb carlitorweb requested a review from brianteeman as a code owner May 3, 2018 15:12
@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label May 3, 2018
<?php echo $field->input; ?>
<?php // If the user has not logged into the site for the first time, then either an administrator has not activated it ?>
<?php // Or in some way the notification mail has not been received yet ?>
<?php if($field->fieldname == 'name' && $this->form->getValue('lastvisitDate') === JFactory::getDbo()->getNullDate()) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space after if

{
// Check for request forgeries.
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove tabs

public function activate()
{
// Check for request forgeries.
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing tabs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also line 99 with trailing tabs.

{
$dispatcher = JEventDispatcher::getInstance();
$user = JFactory::getUser();
$config = JFactory::getConfig();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align =

@carlitorweb
Copy link
Member Author

carlitorweb commented May 3, 2018

@brianteeman what you think? (the warning: Could not start mail function, is because of a wrong config on my local)
Thank @Quy
video_2018-05-03_105812

@brianteeman
Copy link
Contributor

I'm on my phone but the button says send email? And it activates and sends email?

If so then I personally would just call the button "activate"

To me that would be the expected behaviour

@carlitorweb
Copy link
Member Author

Yes, send email, but active at same time, because if send an email saying to the user can log in now, then that user need be activated for that.

@carlitorweb
Copy link
Member Author

Done. Thank again @Quy

{
$dispatcher = JEventDispatcher::getInstance();
$user = JFactory::getUser();
$user = JFactory::getUser();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align =

@brianteeman
Copy link
Contributor

I still think the text on the button is a little unclear

The admin might think that they have to scroll down and click activate (like they did before) and then click on the button to send the email.

When in fact the button (correctly) does both. So I would prefer something like
"Activate and send email"

COM_USERS_USER_OTEPS="One time emergency passwords"
COM_USERS_USER_OTEPS_DESC="If you do not have access to your two factor authentication device you can use any of the following passwords instead of a regular security code. Each one of these emergency passwords is immediately destroyed upon use. We recommend printing these passwords out and keeping the printout in a safe and accessible location, eg your wallet or a safety deposit box."
COM_USERS_USER_OTEPS_WAIT_DESC="There are no emergency one time passwords generated in your account. The passwords will be generated automatically and displayed here as soon as you activate two factor authentication."
COM_USERS_USER_RESEND_BUTTONTEXT="Resend a notification email"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

==> "Resend activation email"

@carlitorweb
Copy link
Member Author

This commit performs this task through ajax. In this way, the user no need redirect to the com_users list. I will fix the drone errors

@ghost ghost added the J4 Rebase label Jun 16, 2019
@brianteeman
Copy link
Contributor

It would be really great if someone could port this to joomla 4

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 10, 2020
@Quy Quy added Ready to take over This is an abandoned feature which can be taken over by another person to finish it. PR-staging and removed Ready to take over This is an abandoned feature which can be taken over by another person to finish it. RTC This Pull Request is Ready To Commit labels Feb 10, 2020
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 10, 2020
@Quy
Copy link
Contributor

Quy commented Feb 10, 2020

Removed RTC. To be rebased for J4.

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 10, 2020
@wilsonge wilsonge self-assigned this Feb 17, 2020
@ashvini77
Copy link

Error "The file marked for modification does not exist: administrator/components/com_users/controllers/user.php" displayed on applying the patch


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20282.

@brianteeman
Copy link
Contributor

@ashvini77 This PR is for Joomla 3 were you testing on Joomla 4?

@zero-24
Copy link
Contributor

zero-24 commented Aug 8, 2021

Dear @carlitorweb

in preperation of the upcomming release of Joomla 3.10 we have used GitHubs rename feature to rename the staging branch into 3.10-dev. Usually GitHub moves all existing PRs towards the new branch just fine, but here it didnt work. The reason seems to be that the fork of the CMS that was used as base for this PR has been deleted so GitHub does no longer have a base to rebase the PR against the new branch and we are also not able to reopen the PR. For that reason GitHub closed this PR in my name, when this issue is still valid It would require a new PR against the new 3.10-dev or 4.0-dev branch.

@carlitorweb
Copy link
Member Author

@zero-24 Understood. And is correct I deleted that fork. If this PR is still considered, what should I do?

@zero-24
Copy link
Contributor

zero-24 commented Aug 12, 2021

When this is still a feature you would like to have please create a PR against 4.1-dev so it can be tested and @bembelimen can take it into 4.1.

@jjnxpct
Copy link

jjnxpct commented May 31, 2023

Is this feature still being worked on? I have I site where this 'send registration email' button could be very useful ;-)

@mgretz
Copy link

mgretz commented Oct 20, 2023

We would also appreciate a working solution for this.

@brianteeman
Copy link
Contributor

I am using this plugin now https://github.com/Spudley/plg_user_notifyactivation

@tschombes
Copy link

Still an issue in Joomla 5.x


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20282.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.