Feature Language Change Documentation Required NPM Resource Changed PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar carlitorweb
carlitorweb
16 Jan 2023

This is a rework for j4 of this PR #20282

Summary of Changes

The user who are manually actived will receive a notification by email informing his account has been activated.
There is also the option of being able to manually send a reminder email to the user even though the account is already activated (in case the user do not login in the page after X time)
The mail template used is com_users.registration.user.admin_activated

Testing Instructions

Apply the PR and after run npm run build:js -- build/media_source/com_users/js

  1. Open the frontend and create a new user account
  2. Open the User edit view inside the administration, and you will notice a new button in the toolbar
  3. Use the button and check the user was actived and also a email sent to the email of the new user
  • A email will be sent also if the user is actived in the Users list view using the Actions -> Active option

Actual result BEFORE applying this Pull Request

You can active a user, but not notification is sent.

Expected result AFTER applying this Pull Request

You can active a user, but a notification is sent.

Accept suggestions for:

  • Button text
  • Button icon
  • Button color

user

Link to documentations

Please select:

  • Documentation link for docs.joomla.org
    Page: Users:_Edit_Profile -> Document the new toolbar button
    Page: Users -> Here just need mention that active the user will send a email with the notification.

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 16 Jan 2023
Category Administration com_users Language & Strings Repository NPM Change JavaScript
avatar carlitorweb carlitorweb - open - 16 Jan 2023
avatar carlitorweb carlitorweb - change - 16 Jan 2023
Status New Pending
avatar carlitorweb carlitorweb - change - 16 Jan 2023
The description was changed
avatar carlitorweb carlitorweb - edited - 16 Jan 2023
avatar brianteeman
brianteeman - comment - 16 Jan 2023

/me dancing with joy

avatar carlitorweb carlitorweb - change - 16 Jan 2023
The description was changed
avatar carlitorweb carlitorweb - edited - 16 Jan 2023
avatar carlitorweb carlitorweb - change - 16 Jan 2023
Labels Added: Language Change NPM Resource Changed PR-4.3-dev
avatar carlitorweb carlitorweb - change - 16 Jan 2023
The description was changed
avatar carlitorweb carlitorweb - edited - 16 Jan 2023
avatar carlitorweb carlitorweb - change - 16 Jan 2023
The description was changed
avatar carlitorweb carlitorweb - edited - 16 Jan 2023
avatar brianteeman
brianteeman - comment - 17 Jan 2023

Looking good - two small issues

  1. When using the new button I expected to get a message saying "the email has been sent" or something like that
  2. The email that is sent is just the language keys not the values
    image

Guessing that you need to copy the language strings from the site language file to the admin language file

avatar brianteeman
brianteeman - comment - 17 Jan 2023

or maybe the issue is that its not using the mail template

avatar carlitorweb
carlitorweb - comment - 17 Jan 2023

My bad, I totally forgot the "mail sent" notification.

The other issue is weird, that worked for me in local. I will do a fresh Joomla install and check from there, maybe I had some changes made in the repo I was using...but still weird, somehow the mailer is not loading the strings..

I will check later this

avatar carlitorweb
carlitorweb - comment - 17 Jan 2023

@brianteeman Okay you was right, the com_users.ini language loaded was only from the administrator part, as is expected.

So adding the follow:

// Load com_users site language strings
$language = $app->getLanguage();
$language->load('com_users', JPATH_SITE);

Fix the problem. But I really not like this solution. The best approch is just copy the strings to the administrator .ini language file. Is okay do it like this?

avatar brianteeman
brianteeman - comment - 17 Jan 2023

How do the other com_users admin emails do it?
Is it perhaps because you are not using the new mail templates?

avatar carlitorweb
carlitorweb - comment - 17 Jan 2023

Is it perhaps because you are not using the new mail templates?

I using it, yes:

$mailer = new \Joomla\CMS\Mail\MailTemplate('com_users.registration.user.admin_activated', $app->getLanguage()->getTag());
$mailer->addTemplateData($mailData);
$mailer->addRecipient($userMail);

How do the other com_users admin emails do it?

They have all the string in the administrator .ini file

avatar brianteeman
brianteeman - comment - 17 Jan 2023

They have all the string in the administrator .ini file

I cant see them

avatar carlitorweb
carlitorweb - comment - 17 Jan 2023

from here:

COM_USERS_N_USERS_ACTIVATED="%d Users activated."

avatar brianteeman
brianteeman - comment - 17 Jan 2023

Those are not the email strings. These are

COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY="Hello {NAME},\n\nYour account has been activated by an administrator. You can now login at {SITEURL} using the username {USERNAME} and the password you chose while registering."
COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT="Account activated for {NAME} at {SITENAME}"
COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at {SITENAME}.\nThe user has verified their email address and requests that you approve their account.\nThis email has their details:\n\n Name : {NAME} \n email: {EMAIL} \n Username: {USERNAME} \n\nYou can activate the user by selecting the link below:\n{ACTIVATE}"
COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT="Registration approval required for account of {NAME} at {SITENAME}"
COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your {SITENAME} account password. To reset your password, you will need to submit this verification code to verify that the request was legitimate.\n\nThe verification code is {TOKEN}\n\nSelect the URL below and proceed with resetting your password.\n\n{LINK_TEXT} \n\nThank you."
COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT="Your {SITENAME} password reset request"
COM_USERS_EMAIL_REGISTERED_BODY="Hello {NAME},\n\nThank you for registering at {SITENAME}.\n\nYou may now log in to {SITEURL} using the following username and password:\n\nUsername: {USERNAME}\nPassword: {PASSWORD_CLEAR}"
COM_USERS_EMAIL_REGISTERED_BODY_NOPW="Hello {NAME},\n\nThank you for registering at {SITENAME}.\n\nYou may now log in to {SITEURL} using the username and password you registered with."
COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator, \n\nA new user '{NAME}', username '{USERNAME}', has registered at {SITEURL}."
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello {NAME},\n\nThank you for registering at {SITENAME}. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n{ACTIVATE} \n\nAfter activation you may login to {SITEURL} using the following username and password:\n\nUsername: {USERNAME}\nPassword: {PASSWORD_CLEAR}"
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW="Hello {NAME},\n\nThank you for registering at {SITENAME}. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n{ACTIVATE} \n\nAfter activation you may login to {SITEURL} using the following username and the password you entered during registration:\n\nUsername: {USERNAME}"
COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY="Hello {NAME},\n\nThank you for registering at {SITENAME}. Your account is created and must be verified before you can use it.\n\nTo verify the account select the following link or copy-paste it in your browser:\n{ACTIVATE} \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\n\nOnce that account has been activated you may login to {SITEURL} using the following username and password:\n\nUsername: {USERNAME}\nPassword: {PASSWORD_CLEAR}"
COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW="Hello {NAME},\n\nThank you for registering at {SITENAME}. Your account is created and must be verified before you can use it.\n\nTo verify the account select the following link or copy-paste it in your browser:\n{ACTIVATE} \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\n\nOnce that account has been activated you may login to {SITEURL} using the following username and the password you entered during registration:\n\nUsername: {USERNAME}"
COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your {SITENAME} account.\n\nYour username is {USERNAME}.\n\nTo login to your account, select the link below.\n\n{LINK_TEXT} \n\nThank you."
COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT="Your {SITENAME} username"

avatar carlitorweb
carlitorweb - comment - 17 Jan 2023

Right, I though you meant the one used in the actions in the administrator.

The first 2 strings are used in the users registration Model in the site part

$mailer = new MailTemplate('com_users.registration.user.admin_activated', $app->getLanguage()->getTag());

The rest are actions triggered by a normal user, also in the site part.

avatar carlitorweb
carlitorweb - comment - 18 Jan 2023

When using the new button I expected to get a message saying "the email has been sent" or something like that

Done (new string added)

The email that is sent is just the language keys not the values

Done

avatar brianteeman
brianteeman - comment - 18 Jan 2023

Last changes all look good. One more thing

image

The button should not be displayed at all when $isNew

avatar carlitorweb
carlitorweb - comment - 18 Jan 2023

Last changes all look good. One more thing

Done. And don't worry, while more corrections the better. Thank you for the help in this.

avatar brianteeman
brianteeman - comment - 18 Jan 2023

Last changes all look good. One more thing

Done. And don't worry, while more corrections the better. Thank you for the help in this.

Purely self motivated as I need this functionality and currently I just have an ugly hack

avatar brianteeman brianteeman - test_item - 19 Jan 2023 - Tested successfully
avatar brianteeman
brianteeman - comment - 19 Jan 2023

I have tested this item successfully on 8edcee8


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

avatar obuisard obuisard - change - 20 Jan 2023
Labels Added: Documentation Required
avatar Quy
Quy - comment - 20 Jan 2023

Maybe hide the Send Activation Reminder button when lastvisitDate is not null. Currently, clicking on it appears to do nothing and no message.

avatar carlitorweb
carlitorweb - comment - 20 Jan 2023

@Quy thank you, I was asking the wrong question in that check. Now is okay

avatar obuisard
obuisard - comment - 4 Feb 2023

Please do not merge, the branch is in 'freeze' state until Tuesday. Thank you!

avatar HLeithner
HLeithner - comment - 18 Feb 2023

@obuisard is this ready to merge? or is 4.3 closed again?

avatar richard67
richard67 - comment - 18 Feb 2023

@HLeithner It needs 2 human tests again as it has been changed after tests.

avatar bembelimen
bembelimen - comment - 18 Feb 2023

As we're in feature freeze, it's for 4.4.

avatar HLeithner
HLeithner - comment - 18 Feb 2023

4.4 doesn't get new features?

avatar brianteeman
brianteeman - comment - 18 Feb 2023

Feature freeze your xcept for the priviliged few.

So that means that the guided tour component that @obuisard and others have been working hard will not be nmerged until 2024

avatar richard67
richard67 - comment - 18 Feb 2023

4.4 doesn't get new features?

@HLeithner I guess you wanted to ask about 4.3.

avatar HLeithner
HLeithner - comment - 18 Feb 2023

no 4.4 is a bridge release without new features like joomla 3.10

avatar richard67
richard67 - comment - 18 Feb 2023

no 4.4 is a bridge release without new features like joomla 3.10

Ah, yes, I forgot, but now I remember.

avatar brianteeman
brianteeman - comment - 18 Feb 2023

So according to the extended definition of a feature to include anythingn that is not an error that means that nothing new will happen in Joomla until 2024?

avatar HLeithner
HLeithner - comment - 18 Feb 2023

5.0 is planned for mid October 2023

avatar bembelimen
bembelimen - comment - 21 Feb 2023

4.4 doesn't get new features?

Yes, you're right, as it's in parallel, i mixed it up. I mean of course 5.0.

Feature freeze your xcept for the priviliged few.

Yup, there are some exceptions, where the one or other already benefit from, by getting more time to finish a feature, sometimes till Beta 3.

A few months ago, the planned development was too fast, now it's too slow, one never can make it right....

avatar brianteeman
brianteeman - comment - 21 Feb 2023

just asking for consistency. noting that the guided tours is still not ready

avatar MacJoom MacJoom - change - 22 Mar 2023
Labels Added: PR-4.4-dev
Removed: PR-4.3-dev
avatar laoneo
laoneo - comment - 28 Mar 2023

Thank you for your contribution, unfortunately the 4.4-dev branch doesn't get new features. When #40181 is merged this pr should be rebased to 5.0-dev. Thanks for understanding.

avatar ceford ceford - test_item - 15 Sep 2023 - Tested unsuccessfully
avatar ceford
ceford - comment - 15 Sep 2023

I have tested this item 🔴 unsuccessfully on 3edd0e6

At step 2 in the test I get this:

An error has occurred.

    0 There is no "com_users.activate-user-send-email" asset of a "script" type in the registry. 

Call stack
# 	Function 	Location
1 	() 	JROOT/libraries/src/WebAsset/WebAssetRegistry.php:134
2 	Joomla\CMS\WebAsset\WebAssetRegistry->get() 	JROOT/libraries/src/WebAsset/WebAssetManager.php:263
3 	Joomla\CMS\WebAsset\WebAssetManager->useAsset() 	JROOT/libraries/src/WebAsset/WebAssetManager.php:197
4 	Joomla\CMS\WebAsset\WebAssetManager->__call() 	JROOT/administrator/components/com_users/tmpl/user/edit.php:26
5 	include() 	JROOT/libraries/src/MVC/View/HtmlView.php:415
6 	Joomla\CMS\MVC\View\HtmlView->loadTemplate() 	JROOT/libraries/src/MVC/View/HtmlView.php:203
7 	Joomla\CMS\MVC\View\HtmlView->display() 	JROOT/administrator/components/com_users/src/View/User/HtmlView.php:133
8 	Joomla\Component\Users\Administrator\View\User\HtmlView->display() 	JROOT/libraries/src/MVC/Controller/BaseController.php:697
9 	Joomla\CMS\MVC\Controller\BaseController->display() 	JROOT/administrator/components/com_users/src/Controller/DisplayController.php:130
10 	Joomla\Component\Users\Administrator\Controller\DisplayController->display() 	JROOT/libraries/src/MVC/Controller/BaseController.php:730
11 	Joomla\CMS\MVC\Controller\BaseController->execute() 	JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143
12 	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() 	JROOT/libraries/src/Component/ComponentHelper.php:361
13 	Joomla\CMS\Component\ComponentHelper::renderComponent() 	JROOT/libraries/src/Application/AdministratorApplication.php:150
14 	Joomla\CMS\Application\AdministratorApplication->dispatch() 	JROOT/libraries/src/Application/AdministratorApplication.php:195
15 	Joomla\CMS\Application\AdministratorApplication->doExecute() 	JROOT/libraries/src/Application/CMSApplication.php:306
16 	Joomla\CMS\Application\CMSApplication->execute() 	JROOT/administrator/includes/app.php:58
17 	require_once() 	JROOT/administrator/index.php:32 

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39650.
avatar richard67
richard67 - comment - 15 Sep 2023

@ceford Also this PR here has conflicts shown on GitHub.

avatar HLeithner
HLeithner - comment - 30 Sep 2023

This pull request has been automatically rebased to 5.1-dev.

avatar Hackwar Hackwar - change - 29 Mar 2024
Labels Added: Feature PR-5.0-dev
Removed: PR-4.4-dev
avatar Hackwar
Hackwar - comment - 29 Mar 2024

I tried to solve the conflicts in this PR. @carlitorweb can you check if it is correct the way I did it?

avatar brianteeman
brianteeman - comment - 2 Apr 2024

@Hackwar this is on my todo list for the morning.

Could you fix the unused import that phpcs has highlighted

avatar brianteeman brianteeman - test_item - 3 Apr 2024 - Tested successfully
avatar brianteeman
brianteeman - comment - 3 Apr 2024

I have tested this item ✅ successfully on 6f8fe41


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

avatar brianteeman
brianteeman - comment - 3 Apr 2024

Other than the minor cs issue this works perfectly!!!


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

avatar Quy Quy - change - 3 Apr 2024
Labels Added: PR-5.1-dev
avatar brianteeman brianteeman - test_item - 3 Apr 2024 - Tested successfully
avatar brianteeman
brianteeman - comment - 3 Apr 2024

I have tested this item ✅ successfully on f5cf34a


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

avatar HLeithner
HLeithner - comment - 24 Apr 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Notification email on admin registration approval
[5.2] Notification email on admin registration approval
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar Sieger66 Sieger66 - test_item - 4 May 2024 - Tested successfully
avatar Sieger66
Sieger66 - comment - 4 May 2024

I have tested this item ✅ successfully on f5cf34a

Works,
but the activated-email to the new user comes in the backend-language of the "Super User" who
click to the button"Activate & Send Email" or "Send Activation Reminder"-button,
and not in the default-language of the website as the registration-emails.

The registration-emails comes with this PR and without this PR in the default-language of the website.

default-language:
https://help.joomla.org/proxy?keyref=Help51:Languages:_Installed


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39650.
avatar richard67 richard67 - change - 4 May 2024
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 4 May 2024

RTC


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

avatar richard67 richard67 - change - 4 May 2024
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 4 May 2024

Back to pending due to merge conflicts.


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

avatar richard67 richard67 - change - 4 May 2024
Labels Added: PR-5.2-dev
Removed: PR-5.0-dev PR-5.1-dev
avatar richard67 richard67 - change - 4 May 2024
Status Pending Ready to Commit
Build 4.3-dev 5.2-dev
avatar richard67
richard67 - comment - 4 May 2024

RTC


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

avatar brianteeman
brianteeman - comment - 4 May 2024

@richard67 how can this be RTC when we have this comment #39650 (comment)

avatar richard67
richard67 - comment - 4 May 2024

@richard67 how can this be RTC when we have this comment #39650 (comment)

@brianteeman Why does @Sieger66 then post a successful test result if it is not successful?

@carlitorweb Is it intended that the email goes out in the backend language of the admin user?

avatar richard67 richard67 - change - 4 May 2024
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 4 May 2024

Back to pending due to necessary clarification.


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

avatar brianteeman
brianteeman - comment - 4 May 2024

I can't speak for @Sieger66

What I have observed in other test reports is -" i tested this according to the instructions and it did what it said" but I also think

  • its a bad idea
  • its missing x
  • y happens now

The current system doesnt really allow for that.

avatar carlitorweb
carlitorweb - comment - 5 May 2024

Note: Remember when you install a new language and you want to use the mail template, is neccessary go to the Mail Template section, enter to the template you want to use and save it. Doing this, then the proper tag is generated in the language column of the mail_templates table. If not, always will fallback to en-GB

image

avatar Sieger66 Sieger66 - test_item - 5 May 2024 - Tested unsuccessfully
avatar Sieger66
Sieger66 - comment - 5 May 2024

I have tested this item 🔴 unsuccessfully on b13a47a

After your last commit the com_users.registration.user.admin_activated - email comes only with the two language-Strings in the email:
in subject is only "COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT"
in body is only "COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY"

Then i go to the Mail Template section to "com_users.registration.user.admin_activated" email-template
and click to save in german and english language version.(Only this two languages are installed in the website)
Now the com_users.registration.user.admin_activated - email comes with the correct text but ever in the english language in the email!
The default-language of the website and the "administrator backend-language" have no affect to the language in this email.
I think that is not correct.

All other "registration-emails" for example:
com_users.registration.user.admin_activation
com_users.registration.admin.verification_request
comes in the default-language of the website.

default-language:
https://help.joomla.org/proxy?keyref=Help51:Languages:_Installed


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39650.
avatar carlitorweb
carlitorweb - comment - 5 May 2024

@Sieger66 We have 2 default language param, one is for the administrator and the other is for the frontend. Right now, the email go out with the default language of the administrator.

If I understand well, what you looking for is, the email go out with the default language of the frontend, is this correct?

avatar Sieger66
Sieger66 - comment - 5 May 2024

Yes, this is correct.
Ohh! I now see the default-language param for the administrator and
the email go out with the default language of the administrator.
In detail the "com_users.registration.user.admin_activated" email comes allways with this language with your last commit.
But the other emails comes in the language of the default-language param for the site.

I dont know is it intended and is it correct usecase.

Other small issue:
In the sent notification message in backend comes only the language-key:
COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_SUCCESS
and not the value(text).


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

avatar carlitorweb
carlitorweb - comment - 5 May 2024

@Sieger66 issue fixed

Now the email will go out with the site default language.

avatar Sieger66 Sieger66 - test_item - 5 May 2024 - Tested successfully
avatar Sieger66
Sieger66 - comment - 5 May 2024

I have tested this item ✅ successfully on c375030

Works as aspected.
@brianteeman : Now we need a second test.


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

Add a Comment

Login with GitHub to post a comment