? Language Change ? Success

User tests: Successful: Unsuccessful:

avatar carlitorweb
carlitorweb
2 May 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
avatar carlitorweb carlitorweb - open - 2 May 2018
avatar carlitorweb carlitorweb - change - 2 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2018
Category Administration com_users
avatar brianteeman
brianteeman - comment - 2 May 2018

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

avatar carlitorweb
carlitorweb - comment - 2 May 2018

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

avatar brianteeman
brianteeman - comment - 2 May 2018

@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

avatar carlitorweb carlitorweb - change - 2 May 2018
The description was changed
avatar carlitorweb carlitorweb - edited - 2 May 2018
avatar carlitorweb
carlitorweb - comment - 2 May 2018

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.

avatar carlitorweb carlitorweb - change - 3 May 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 3 May 2018
Category Administration com_users Administration com_users Language & Strings
avatar carlitorweb
carlitorweb - comment - 3 May 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

avatar brianteeman
brianteeman - comment - 3 May 2018

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

avatar carlitorweb
carlitorweb - comment - 3 May 2018

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.

avatar carlitorweb carlitorweb - change - 3 May 2018
Labels Added: ?
avatar carlitorweb
carlitorweb - comment - 3 May 2018

Done. Thank again @Quy

avatar carlitorweb carlitorweb - change - 3 May 2018
The description was changed
avatar carlitorweb carlitorweb - edited - 3 May 2018
avatar carlitorweb carlitorweb - change - 3 May 2018
The description was changed
avatar carlitorweb carlitorweb - edited - 3 May 2018
avatar carlitorweb carlitorweb - change - 3 May 2018
The description was changed
avatar carlitorweb carlitorweb - edited - 3 May 2018
avatar carlitorweb carlitorweb - change - 4 May 2018
The description was changed
avatar carlitorweb carlitorweb - edited - 4 May 2018
avatar brianteeman
brianteeman - comment - 5 May 2018

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"

avatar carlitorweb
carlitorweb - comment - 5 May 2018

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

avatar infograf768
infograf768 - comment - 6 May 2018

Still many CS, but most important is that the mail does not contain the strings values:

screen shot 2018-05-06 at 09 41 05

EDIT: which is normal as they are only present in frontend... 😄

NOTE: Once the strings added, let's not forget the language used would be the language of the admin UI when the button is clicked, not always the language used by the new user who registered on frontend.

avatar infograf768
infograf768 - comment - 7 May 2018

You need to add these language strings in backend.

avatar carlitorweb
carlitorweb - comment - 7 May 2018

Yes, I on it. But I was config phpcs well here for Joomla, for start coding better for the CMS

avatar infograf768
infograf768 - comment - 7 May 2018

But I was config phpcs well here for Joomla, for start coding better for the CMS

👍

avatar carlitorweb
carlitorweb - comment - 7 May 2018

Thank you again @infograf768 . I added the 2 missing string, and also, change the strings for the 2 different activations. When you want active the user for 1st time, and when you want send a reminder

avatar infograf768
infograf768 - comment - 8 May 2018

Looks like the strings should be correctly grouped for Reminder and Activate in the model.

avatar carlitorweb
carlitorweb - comment - 8 May 2018

correctly grouped for Reminder and Activate

Sorry, not understand well what you suggest.

avatar infograf768
infograf768 - comment - 9 May 2018

I meant using the right language constants for the mail sent:

COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT
should go with
COM_USERS_EMAIL_NOTIFICATION_ACTIVATED_BODY

COM_USERS_EMAIL_NOTIFICATION_ACTIVATED_REMINDER_SUBJECT
with
COM_USERS_EMAIL_NOTIFICATION_ACTIVATED_REMINDER_BODY

in

+						if (!empty($wasActive))
+						{
+							// Then we wanted active the user and send a email notification
+							// Compute the user mail notification subject.
+							$emailSubject = JText::sprintf(
+								'COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT',
+								$table->name,
+								$config->get('sitename')
+							);
+
+							// Compute the user mail notification body.
+							$emailBody = JText::sprintf(
+								'COM_USERS_EMAIL_NOTIFICATION_ACTIVATED_REMINDER_BODY',
+								$table->name,
+								JUri::root(),
+								$table->username
+							);
+						}
+						else
+						{
+							// Then we wanted only send again the email notification
+							$emailSubject = JText::sprintf(
+								'COM_USERS_EMAIL_NOTIFICATION_ACTIVATED_REMINDER_SUBJECT',
+								$config->get('sitename')
+							);
+
+							// Compute the user mail notification body.
+							$emailBody = JText::sprintf(
+								'COM_USERS_EMAIL_NOTIFICATION_ACTIVATED_BODY',
+								$table->name,
+								JUri::root(),
+								$table->username
+							);
+						}
avatar carlitorweb
carlitorweb - comment - 9 May 2018

Good catch @infograf768 . Thank you again, and sorry for no understand well before.

avatar joomla-cms-bot joomla-cms-bot - change - 9 May 2018
Category Administration com_users Language & Strings Repository Administration com_categories com_users Language & Strings Front End com_content com_search SQL Installation Postgresql MS SQL Libraries JavaScript External Library
avatar joomla-cms-bot joomla-cms-bot - change - 9 May 2018
Category Administration com_users Language & Strings Repository com_categories Front End com_content com_search SQL Installation Postgresql MS SQL Libraries JavaScript External Library Administration com_users Language & Strings
avatar carlitorweb
carlitorweb - comment - 9 May 2018

Sorry here, made a mistake

avatar carlitorweb
carlitorweb - comment - 9 May 2018

Thank again @Quy

avatar carlitorweb carlitorweb - change - 19 May 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-05-19 14:35:31
Closed_By carlitorweb
avatar carlitorweb carlitorweb - close - 19 May 2018
avatar carlitorweb carlitorweb - close - 19 May 2018
avatar carlitorweb carlitorweb - change - 19 May 2018
Status Closed New
Closed_Date 2018-05-19 14:35:31
Closed_By carlitorweb
avatar carlitorweb carlitorweb - change - 19 May 2018
Status New Pending
avatar carlitorweb carlitorweb - reopen - 19 May 2018
avatar carlitorweb carlitorweb - reopen - 19 May 2018
avatar carlitorweb
carlitorweb - comment - 20 Jun 2018

Some news about this?

avatar carlitorweb
carlitorweb - comment - 20 Jun 2018

Thank @Quy

avatar jjnxpct
jjnxpct - comment - 11 Nov 2018

I have tested this item successfully on 6ee10de

I tested this on Joomla 3.9. It seemed to work OK!


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

avatar jjnxpct jjnxpct - test_item - 11 Nov 2018 - Tested successfully
avatar twister65
twister65 - comment - 12 Nov 2018

I have tested this item successfully on 6ee10de

I think the button text :

COM_USERS_USER_RESEND_BUTTONTEXT="Activate and resend activation email"

should be :
COM_USERS_USER_RESEND_BUTTONTEXT="Resend activation email"
because the user is already activated.


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

avatar twister65 twister65 - test_item - 12 Nov 2018 - Tested successfully
avatar jjnxpct
jjnxpct - comment - 12 Nov 2018

@twister65 Not sure if that is right. They way I see this being used is that a new users creates an account, the verifies (not actovates) his/her email. Then the admin gets notified and can use this button to activate the user. Only then a notification email is send to the new user.

So this button would only be used with users that have not already been activated.

Or will this also be used to resend this mail? Or are those actually two different functions?

I started looking at this PR after having issues with the link in the request-for-activation mail to the site manager did not work anymore without logging in to the (site (frontend). When adding this feature a site admin can - in stead of using the link in the mail - activate the user form the backend. Just by clicking on the activation icon in the user list. Or by clicking on the button.

But maybe I am missing something...

avatar twister65
twister65 - comment - 12 Nov 2018

@jjnxpct, if the user is not activated the button text is different :

COM_USERS_USER_SEND_BUTTONTEXT="Activate and send email"

I confirm that a message informs the site manager if the email has been sent or not.

avatar jjnxpct
jjnxpct - comment - 13 Nov 2018

@twister65 ah, I see. We have
COM_USERS_USER_SEND_BUTTONTEXT and
COM_USERS_USER_RESEND_BUTTONTEXT

I am not quit sure in what situation you would need to resend this e-mail? Maybe the button could also just not show when already activated?

avatar jjnxpct
jjnxpct - comment - 27 Nov 2018

What's next?

avatar Quy Quy - change - 20 Feb 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 20 Feb 2019

RTC


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

avatar infograf768 infograf768 - change - 21 Feb 2019
Labels Added: ?
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category Administration com_users Language & Strings Administration com_users
avatar joomla-cms-bot joomla-cms-bot - change - 5 Jun 2019
Category Administration com_users Administration com_users Language & Strings
avatar brianteeman
brianteeman - comment - 15 Jun 2019

What's preventing this important improvement from being merged? @HLeithner

avatar HLeithner
HLeithner - comment - 16 Jun 2019

For my first thought it looks as a new feature for me and I don't know why it wasn't merged into 3.9 maybe it wasn't finished.

I would like to see it changed to J4. btw. there are some cs errors in the code.

avatar carlitorweb carlitorweb - change - 17 Jun 2019
Labels Added: ?
avatar brianteeman
brianteeman - comment - 10 Feb 2020

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

avatar Quy Quy - change - 10 Feb 2020
Status Ready to Commit Confirmed
avatar Quy
Quy - comment - 10 Feb 2020

Removed RTC. To be rebased for J4.

avatar ashvini77
ashvini77 - comment - 7 Nov 2020

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.

avatar brianteeman
brianteeman - comment - 7 Nov 2020

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

avatar zero-24 zero-24 - change - 8 Aug 2021
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2021-08-08 20:08:55
Closed_By zero-24
Labels Added: ? Language Change
Removed: ? ?
avatar zero-24 zero-24 - close - 8 Aug 2021
avatar zero-24
zero-24 - comment - 8 Aug 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.

avatar carlitorweb
carlitorweb - comment - 12 Aug 2021

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

avatar zero-24
zero-24 - comment - 12 Aug 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.

avatar jjnxpct
jjnxpct - comment - 31 May 2023

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

avatar mgretz
mgretz - comment - 20 Oct 2023

We would also appreciate a working solution for this.

avatar brianteeman
brianteeman - comment - 20 Oct 2023
avatar tschombes
tschombes - comment - 17 Jan 2024

Still an issue in Joomla 5.x


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

Add a Comment

Login with GitHub to post a comment