Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Notification email on admin registration approval #39650

Open
wants to merge 36 commits into
base: 5.3-dev
Choose a base branch
from

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

@carlitorweb
Copy link
Member Author

@Sieger66 issue fixed

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

@Sieger66
Copy link
Contributor

Sieger66 commented May 5, 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.

@carlitorweb
Copy link
Member Author

Close due lack of interest

@carlitorweb carlitorweb deleted the activate_send_email branch July 31, 2024 16:25
@brianteeman
Copy link
Contributor

hey - lots of interest from me -
image

@HLeithner
Copy link
Member

@carlitorweb would you please recover your branch? I added it for the next wednesday maintainer meeting

@carlitorweb carlitorweb restored the activate_send_email branch August 14, 2024 17:18
@carlitorweb
Copy link
Member Author

@carlitorweb would you please recover your branch? I added it for the next wednesday maintainer meeting

Done

@carlitorweb carlitorweb reopened this Aug 14, 2024
carlitorweb and others added 2 commits August 16, 2024 03:23
…er.php

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
…er.php

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@fgsw
Copy link

fgsw 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.

@fgsw
Copy link

fgsw 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
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-5.3-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.