J4 Rebase Language Change PR-staging RTC

Failure

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: PR-staging
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: Language Change
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: RTC
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: J4 Rebase
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.

Add a Comment

Login with GitHub to post a comment