Skip to content

Conversation

@carlitorweb
Copy link
Member

@carlitorweb carlitorweb commented Jan 16, 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

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.3-dev labels Jan 16, 2023
@brianteeman
Copy link
Contributor

/me dancing with joy

@brianteeman
Copy link
Contributor

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

@brianteeman
Copy link
Contributor

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

@carlitorweb
Copy link
Member Author

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

@carlitorweb
Copy link
Member Author

carlitorweb commented Jan 17, 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?

@brianteeman
Copy link
Contributor

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

@carlitorweb
Copy link
Member Author

carlitorweb commented Jan 17, 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

@ghost
Copy link

ghost commented Aug 18, 2024

@carlitorweb resolving the 2 conversations is needed before a test?

@carlitorweb
Copy link
Member Author

@carlitorweb resolving the 2 conversations is needed before a test?

yes, working on it

@carlitorweb
Copy link
Member Author

Okay, I think is ready.

@ghost
Copy link

ghost commented Aug 19, 2024

@carlitorweb thanks for your work.

I'm unable to get an email (verification link) after the registration is send. In "Global Configuration > Server > Mail – Send Test Mail" no E-Mail arrived.

The Button "Activate and send e-mail" seems to work and changed to "Send Activation Reminder".

Sorry, no test.

For other test user: To be able to create a user account in the Frontend you have to open "User Options > Allow User Registration – Yes".

Test System Information:
Sample Data – Testing
PHP Built On Darwin Air.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 x86_64
Database Type mysql
Database Version 8.0.35
Database Collation utf8mb4_unicode_ci
Database Connection Collation utf8mb4_0900_ai_ci
Database Connection Encryption None
Database Server Supports Connection Encryption Yes
PHP Version 8.3.8
Web Server Apache/2.4.58 (Unix) OpenSSL/1.1.1u mod_fastcgi/mod_fastcgi-SNAP-0910052141
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 5.2.0-alpha4-dev Development [ Uthabiti ] 23-July-2024 16:01 GMT
Joomla Backward Compatibility Plugin Disabled
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0

@HLeithner
Copy link
Member

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

@HLeithner HLeithner changed the title [5.2] Notification email on admin registration approval [5.3] Notification email on admin registration approval Sep 2, 2024
@Hackwar Hackwar removed the PR-5.2-dev label Sep 3, 2024
@HLeithner HLeithner changed the base branch from 5.3-dev to 6.0-dev March 4, 2025 17:22
@HLeithner
Copy link
Member

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

@HLeithner HLeithner changed the title [5.3] Notification email on admin registration approval [6.0] Notification email on admin registration approval Mar 4, 2025
@rdeutz rdeutz removed the PR-5.3-dev label Mar 5, 2025
@exlemor exlemor moved this to Abandoned in PR Cleanup May 10, 2025
@brianteeman
Copy link
Contributor

Looks like with all the rebases something has broken in this PR. Would love to see this in j6

@brianteeman
Copy link
Contributor

I have rebuilt this PR so that it can be tested #45802

@richard67
Copy link
Member

Closing in favour of @45802 . Thanks @carlitorweb .

@richard67 richard67 closed this Jul 30, 2025
@github-project-automation github-project-automation bot moved this from Abandoned to Held for B/C break in PR Cleanup Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Required Feature Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.0-dev

Projects

Status: Held for B/C break

Development

Successfully merging this pull request may close these issues.