Skip to content

[5.4] Autoupdate email groups#45721

Merged
muhme merged 38 commits intojoomla:5.4-devfrom
chmst:54-autoupdate-email-groups
Aug 28, 2025
Merged

[5.4] Autoupdate email groups#45721
muhme merged 38 commits intojoomla:5.4-devfrom
chmst:54-autoupdate-email-groups

Conversation

@chmst
Copy link
Contributor

@chmst chmst commented Jul 14, 2025

Pull Request for Issue (#45685 (comment)).

Change this PR to configure user group(s) (like for the standard task operations) instead of having an input field for email addresses.

Summary of Changes

The PR fixes the hard coded default super user group = 8 for notifications, it gets all super user groups from assets.

Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.
The user must be in a user group which can be selected in the form.
If there is no input in the field or if the selected groups are empty, all active super users get a notification.

Testing Instructions

Make one or more user groups with different users.
User can have senEmali Options or not, can be blocked or not, can be super users or not.
Play around with empty groups, blocked users ..

Add / remove / change selected user groups in the automated update configuration.
Check if all and only users with valid email-address and permission to receive system emails get the email after autoUpdate.

There is a quick and dirty workaround for testing the sendNotification method without the automated update.

Add this into any displayContoller.php, for example com_content:
https://github.com/joomla/joomla-cms/blob/5.4-dev/administrator/components/com_content/src/Controller/DisplayController.php in the display method.

        // Testonly sendNotification
        $notificationModel = \Joomla\CMS\Factory::getApplication()->bootComponent('com_joomlaupdate')
            ->getMVCFactory()->createModel('Notification', 'Administrator');

        $notificationModel->sendNotification('success', '5.4.115' , '5.4.116');

Then go to a view of that component in backend. This acrivate the sendNotification Method.

You can check the email-addresses here:
administrator\components\com_joomlaupdate\src\Model\NotificationModel.php befor the messages are sent:

Simple code snippet if you don't use xdebug:


        // Debugging output
        echo '<pre>';
        echo htmlspecialchars(print_r($emailReceivers, true));
        echo '</pre>';
        exit;

Actual result BEFORE applying this Pull Request

grafik

Expected result AFTER applying this Pull Request

The input form for the Plugin
grafik

The output:
All depends on the input and on the differen users configuration. All users from the input who are not blocked and have sendMail = 1 are listed, only one times.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@chmst chmst requested a review from rdeutz as a code owner July 14, 2025 09:45
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.4-dev labels Jul 14, 2025
@Fedik Fedik added the Feature label Jul 14, 2025
@Fedik
Copy link
Member

Fedik commented Jul 14, 2025

It still should check for Users with sendEmail = 1 ("Receive System Emails" parameter). Please keep that.

chmst and others added 2 commits July 14, 2025 14:18
Co-authored-by: Brian Teeman <brian@teeman.net>
…onModel.php

Co-authored-by: Brian Teeman <brian@teeman.net>
@richard67 richard67 changed the title [5.4.0] Autoupdate email groups [5.4] Autoupdate email groups Jul 15, 2025
@chmst chmst mentioned this pull request Jul 21, 2025
4 tasks
@muhme
Copy link
Contributor

muhme commented Aug 28, 2025

I have tested this item ✅ successfully on bc99f0b

Tested with manual installation as public available site (to be able to activate Automated Updates)

  • And with the given workaround for testing notifications:
    • 1st snippet into components/com_content/src/Controller/DisplayController.php at start of display()
    • 2nd snippet into administrator/components/com_joomlaupdate/src/Model/NotificationModel.php in sendNotification() before // Send emails to all receivers
  • Created one article and using preview to see email receivers debug output
  • Enabled Automated Updates
  • Enabled 'Debug System' and 'Log Almost Everything'
  • Created users and assigned groups and in general user is enabled and with 'Receive System Emails'
    • admin, Registered + Super Users
    • admin2, Registered + Super Users + Update-To-Be-Informed
    • christiane, Registered + Update-To-Be-Informed
    • heiko, Registered + Update-To-Be-Informed
    • richard, Registered + Publisher
    • fedir, Registered + Super Users + Update-To-Be-Informed, disabled user
    • emmanuel, Registered + Super User + Update-To-Be-Informed, disabled 'Receive System Emails'
  • Initial empty group selection field
    • ✅ Email to admin and admin2
  • Using Update-To-Be-Informed group
    • ✅ Email to heiko, christiane and admin2
  • Using 'Super Users' + Update-To-Be-Informed group
    • ✅ Email to heiko, christiane, admin and admin2
  • Using Manager group (w/o members )
    • ✅ Email to admin and admin2
  • Using Manager and Update-To-Be-Informed group
    • ✅ Email to heiko, christiane and admin2
  • Using Registered group
    • ✅ Email to admin, heiko, christiane, admin2 and richard
  • Final disabled 'Receive System Emails' for all users and empty group selection field
    • ✅ empyt array and not crashing upto the testing workaround
  • ✅ Checked log files administrator/logs/* and PHP
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45721.

@rbuelund
Copy link

I have tested this item ✅ successfully on bc99f0b

I have done more or less the same tests as @muhme


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

@rbuelund
Copy link

I have tested this item ✅ successfully on bc99f0b


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 28, 2025
…onModel.php

Co-authored-by: Brian Teeman <brian@teeman.net>
@brianteeman
Copy link
Contributor

brianteeman commented Aug 28, 2025

Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.

is there an email validation check or did you just mean "obviously if the email address is invalid then they wont receive the email"

@richard67
Copy link
Member

As the last change was just a code comment clarification, the PR doesn't require new tests, and RTC is still valid.

@chmst
Copy link
Contributor Author

chmst commented Aug 28, 2025

Every user who is not blocked and has permission "sendEmail" and has a valid email address can receive a notification.

is there an email validation check or did you just mean "obviously if the email address is invalid then they wont receive the email

There is a email validation check.
The address is checked when a user is saved - but just in case.

@muhme muhme merged commit 1223b9f into joomla:5.4-dev Aug 28, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 28, 2025
@muhme muhme added this to the Joomla! 5.4.0 milestone Aug 28, 2025
@muhme
Copy link
Contributor

muhme commented Aug 28, 2025

Thank you @chmst for your contribution. Thank you @brianteeman, @richard67, @Fedik and @HLeithner for supporting. Thank you @exlemor and @rbuelund for testing.

@muhme
Copy link
Contributor

muhme commented Sep 1, 2025

The test was repeated w/o the given workaround as Alpha (Test) Automated Updates package 5.4.115 with joomla-5.4.0-beta2, with this PR included, is available now. Slightly modified with taking file and database dump after the configuration, checking log files after installation and unregistered from Automated Updates. Recreated from file and database dump for next test.

✅ Running Automated Update 7 (seven) times and checked the email received as specified 👍 😄

rdeutz pushed a commit to rdeutz/joomla-cms that referenced this pull request Sep 2, 2025
---------

Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Heiko Lübbe <github@heikol.de>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: To be tested

Development

Successfully merging this pull request may close these issues.

10 participants