Feature PR-6.1-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.

avatar richard67
richard67 - comment - 9 Feb 2026

Even if it is a small change, but it changes functionality, and it's not a bug fix according to the definition here https://github.com/joomla/joomla-cms?tab=readme-ov-file#which-branch-should-my-pull-request-target .

Therefore I will rebase this PR to the 6.1-dev branch now.

avatar richard67 richard67 - change - 9 Feb 2026
Title
[5.4] Email templates: make tags case insensitive
[6.1] Email templates: make tags case insensitive
avatar richard67 richard67 - edited - 9 Feb 2026
avatar richard67 richard67 - change - 9 Feb 2026
Labels Added: Feature PR-6.1-dev
Removed: PR-5.4-dev
avatar richard67
richard67 - comment - 9 Feb 2026

As I had announced with my previous comment, I've rebased this PR to the 6.1-dev branch.

@465645 @Simran2525-eng @dusries Could you test this again on 6.1?

You could use the latest nightly build for the actual result, and the patched package created by done for the expected result.

The latest 6.1 nightlies can be found here: https://developer.joomla.org/nightly-builds.html

The patched packages and custom update URL for this PR you can find here: https://artifacts.joomla.org/drone/joomla/joomla-cms/6.1-dev/46787/downloads/91098/

Thanks in advance.

avatar brianteeman
brianteeman - comment - 9 Feb 2026

it changes functionality in that it fixes a bug. It doesn't break anything

image
avatar richard67
richard67 - comment - 9 Feb 2026

it changes functionality in that it fixes a bug. It doesn't break anything

@brianteeman It has been discussed in the maintainers team and we came to the conclusion to move it to 6.1.

avatar tecpromotion tecpromotion - change - 9 Feb 2026
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-02-09 13:55:30
Closed_By tecpromotion
avatar tecpromotion tecpromotion - close - 9 Feb 2026
avatar tecpromotion tecpromotion - merge - 9 Feb 2026

Add a Comment

Login with GitHub to post a comment