- Issue created by @camilo.escobar
- Merge request !6Issue #3498353: Added option to trigger emails only for authenticated user role. → (Open) created by anish.ir
Hii,
I’ve successfully implemented the changes requested.
Now, the system will only trigger email notifications for users who have only the 'Authenticated user' role. This ensures that users with additional roles (like "Administrator" or "Editor") will not trigger notifications, as per your requirements.
To make this configurable, I’ve added a new checkbox in the settings: "Trigger email if users have the 'Authenticated user' as their only role". This option will only appear when the "Authenticated user" role is selected, allowing administrators to control the behavior more precisely. Also, updated the logic in
admin_content_notification.common::isCurrentUserRoleAllowedToSendNotification
to check the user roles accordingly.Please review the changes and let me know if everything works as expected or if any further adjustments are needed.
I am attaching a screenshot for the reference.
Thank you !- 🇨🇴Colombia camilo.escobar
Hi anish.ir,
Thank you so much for your prompt response and diligent work!
I’ve reviewed the MR and left a couple of comments for your consideration. Please take a look and let me know your thoughts!
Hi camilo.escobar,
Thank you for your detailed review and feedback on the MR. I appreciate the time you took to analyse the changes and provide valuable suggestions.
Regarding the Role Selection and Checkbox:
I’ve implemented the suggested changes to ensure that the "Trigger email if users have the 'Authenticated user' as their only role" checkbox (admin_content_notification_authenticated_user_only) is not effective when the "Authenticated user" role is deselected in the configuration form. This ensures that both configurations work in combination as intended and avoids the problematic scenario you described.And for the Log Entry for Non-Configured Roles:
I’ve considered your comment about logging entries for users with roles that aren’t configured to trigger emails. Since this might not add significant value for admins or developers, I’ve removed the log entries for such cases.Please let me know if there are any further adjustments needed. I’m happy to iterate further.
Thank you again for your guidance!
- 🇨🇴Colombia camilo.escobar
Hi anish.ir,
Thanks for applying the changes! Great job!
logic is implemented to ensure that email notifications are only triggered when both the 'Authenticated user' role is selected in the allowed roles configuration and the 'Trigger email if users have the 'Authenticated user' as their only role' checkbox is checked. checks are present to prevent notifications from being sent if the 'Authenticated user' role is unchecked, even if the checkbox was previously selected. Tested various scenarios to confirm expected behaviour.
So moving it to RTBC.