joomla-cms
joomla-cms copied to clipboard
[5.2] Notification email on admin registration approval
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
- Open the frontend and create a new user account
- Open the User edit view inside the administration, and you will notice a new button in the toolbar
- 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
Link to documentations
Please select:
-
[x] 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.
-
[x] No documentation changes for manual.joomla.org needed
/me dancing with joy
Looking good - two small issues
- When using the new button I expected to get a message saying "the email has been sent" or something like that
- The email that is sent is just the language keys not the values
Guessing that you need to copy the language strings from the site language file to the admin language file
or maybe the issue is that its not using the mail template
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
@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?
How do the other com_users admin emails do it? Is it perhaps because you are not using the new mail templates?
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
They have all the string in the administrator .ini file
I cant see them
from here: https://github.com/joomla/joomla-cms/blob/92c014932228dae7a225184a04b01f0566b336c9/administrator/language/en-GB/com_users.ini#L323
Those are not the email strings. These are https://github.com/joomla/joomla-cms/blob/92c014932228dae7a225184a04b01f0566b336c9/language/en-GB/com_users.ini#L11-L25
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 https://github.com/joomla/joomla-cms/blob/92c014932228dae7a225184a04b01f0566b336c9/components/com_users/src/Model/RegistrationModel.php#L214
The rest are actions triggered by a normal user, also in the site part.
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
Last changes all look good. One more thing
The button should not be displayed at all when $isNew
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.
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
I have tested this item :white_check_mark: successfully on 8edcee8a552a37b9fca58bc862e712230c837d5c
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39650.
Maybe hide the Send Activation Reminder
button when lastvisitDate
is not null. Currently, clicking on it appears to do nothing and no message.
@Quy thank you, I was asking the wrong question in that check. Now is okay
Please do not merge, the branch is in 'freeze' state until Tuesday. Thank you!
@obuisard is this ready to merge? or is 4.3 closed again?
@HLeithner It needs 2 human tests again as it has been changed after tests.
As we're in feature freeze, it's for 4.4.
4.4 doesn't get new features?
~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
4.4 doesn't get new features?
@HLeithner I guess you wanted to ask about 4.3.
no 4.4 is a bridge release without new features like joomla 3.10
no 4.4 is a bridge release without new features like joomla 3.10
Ah, yes, I forgot, but now I remember.
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?
5.0 is planned for mid October 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....