PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar e4e5Ke2
e4e5Ke2
30 Jan 2026

Pull Request for Issue #46318

Summary of Changes

  • Made the replaceTags method (of MailTemplate.php) case insensitive
    - Simplified some redundant code in said method with a closure

Testing Instructions

Insert tags into any email templates, written in upper or lower case. They should now work regardless of case.

Actual result BEFORE applying this Pull Request

E.g. the tag {sitename} as part of a mail template did not work. Only in upper case the tag {SITENAME} gets replaced with a value.

Expected result AFTER applying this Pull Request

Now tags work regardless of being written in lower or upper case. E.g. {sitename} will now work the same way as {SITENAME}.

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

avatar e4e5Ke2 e4e5Ke2 - open - 30 Jan 2026
avatar e4e5Ke2 e4e5Ke2 - change - 30 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jan 2026
Category Libraries
avatar brianteeman
brianteeman - comment - 30 Jan 2026

please remove the unrelated ai generated code changes and just stick to fixing the issue

avatar e4e5Ke2
e4e5Ke2 - comment - 30 Jan 2026

Yeah, I didnt use AI for anything.. just saw a simplification since I was touching this method anyways. I'd be happy to contribute more fixes in the future, but not sure I like the tone here..

avatar exlemor
exlemor - comment - 30 Jan 2026

Yeah, I didnt use AI for anything.. just saw a simplification since I was touching this method anyways. I'd be happy to contribute more fixes in the future, but not sure I like the tone here..

Hi @e4e5Ke2,

Welcome! Thank you for your 1st contribution to Joomla!

Please join us on Mattermost and get to know the Community!

( The AI comment wasn't meant negatively. Hope that you get to know Joomla coding standards, to exchange with you in Mattermost, to seeing you during PBF tomorrow and to your future participation! Cheers! )

avatar 465645 465645 - test_item - 31 Jan 2026 - Tested successfully
avatar 465645
465645 - comment - 31 Jan 2026

I have tested this item ✅ successfully on 614c576

C:\xampp\htdocs\joomlapbf\libraries\src\Mail\MailTemplate.php


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

avatar 465645 465645 - test_item - 31 Jan 2026 - Tested successfully
avatar 465645
465645 - comment - 31 Jan 2026

I have tested this item ✅ successfully on 614c576

C:\xampp\htdocs\joomlapbf\libraries\src\Mail\MailTemplate.php
This single-line change wraps the $key variable with strtoupper() to convert tag keys to uppercase before creating the placeholder pattern. This ensures that:

Tag keys are normalized to uppercase (e.g., 'sitename' becomes 'SITENAME')
The placeholder pattern becomes {SITENAME} regardless of how the key was originally defined
str_ireplace() can then match {SITENAME}, {sitename}, {SiteName}, etc. in the template text


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

avatar Simran2525-eng Simran2525-eng - test_item - 31 Jan 2026 - Not tested
avatar Simran2525-eng
Simran2525-eng - comment - 31 Jan 2026

I have not tested this item.

Tested this patch on Joomla 5.4-dev.

Before applying the patch, only uppercase email template tags like {SITENAME} worked.
After applying the patch, tags work correctly in both uppercase and lowercase
(e.g. {SITENAME}, {sitename}).

Patch works as expected. Test successful.


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

avatar Simran2525-eng Simran2525-eng - test_item - 31 Jan 2026 - Tested successfully
avatar Simran2525-eng
Simran2525-eng - comment - 31 Jan 2026

I have tested this item ✅ successfully on 614c576

Tested this patch on Joomla 5.4-dev.

Before applying the patch, only uppercase email template tags like {SITENAME} worked.
After applying the patch, tags work correctly in both uppercase and lowercase
(e.g. {SITENAME}, {sitename}).

Patch works as expected. Test successful.


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

avatar dusries
dusries - comment - 31 Jan 2026

I have successfully tested this item.


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

avatar e4e5Ke2 e4e5Ke2 - change - 31 Jan 2026
Labels Added: PR-5.4-dev
avatar e4e5Ke2 e4e5Ke2 - change - 31 Jan 2026
The description was changed
avatar e4e5Ke2 e4e5Ke2 - edited - 31 Jan 2026
avatar e4e5Ke2
e4e5Ke2 - comment - 31 Jan 2026

Removed the closures, functionality should be unchanged.

Add a Comment

Login with GitHub to post a comment