Feature RTC PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar SniperSister
SniperSister
13 Feb 2025

Summary of Changes

The new mail template layout introduced in 5.3 (https://docs.joomla.org/J5.x:Managing_Mail_Template_Layout) currently has no access to the actual mail template. This prevents some interesting usecases, accessing the parameters of the template to retrieve extra information.

This PR adds $mail to the rendered layout, making the template available on render.

Testing Instructions

  • Configure your site for the usage of HTML templates by setting the Mail Format to "HTML" and enabling the "Mail Template Layout" in the mail template settings
  • Add a temporary debug statement to layouts/joomla/mail/mailtemplate.php around line 34: var_dump($extraData);die();
  • trigger the submission of a system mail, i.e. by starting a password reset

Actual result BEFORE applying this Pull Request

No information about the current template is available in the debug output.

Expected result AFTER applying this Pull Request

The debug output has a "mail" item, comparable to this output:
Bildschirmfoto 2025-02-22 um 09 39 51

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 SniperSister SniperSister - open - 13 Feb 2025
avatar SniperSister SniperSister - change - 13 Feb 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Feb 2025
Category Libraries
avatar SniperSister SniperSister - change - 13 Feb 2025
The description was changed
avatar SniperSister SniperSister - edited - 13 Feb 2025
avatar SniperSister SniperSister - change - 13 Feb 2025
Labels Added: PR-5.3-dev
avatar LadySolveig
LadySolveig - comment - 19 Feb 2025
avatar SniperSister
SniperSister - comment - 19 Feb 2025

@LadySolveig this PR does not add the Mailer object but the Mailtemplate. That’s an stdclass holding the data stored in the DB, so I don’t think the point made in the linked discussion can be applied here.

avatar LadySolveig
LadySolveig - comment - 19 Feb 2025

Not so sure if I understand right.
You want the option to use the data for a specific mail template in the wrapper and that data is not availabel in every mail template?

As Fedik metioned

Because it breaks whole concept of layout system.
The layout is the "end-point", just rendering, nothing more.

I just pinned it because I don't necessarily think the wrapper is the right place.
But I don't intend to block it if that's what you want :) I just linked it as a reference.

avatar SniperSister
SniperSister - comment - 19 Feb 2025

@LadySolveig i want the currently used mailtemplate as “context” while rendering the wrapper. As far as I understood Fedik, his concern in the linked comment was that it would provide access to the mailer object (business logic) while in my PR it’s about the mail object (which is just representational data).

avatar shrutidhole123 shrutidhole123 - test_item - 22 Feb 2025 - Tested unsuccessfully
avatar shrutidhole123
shrutidhole123 - comment - 22 Feb 2025

I have tested this item 🔴 unsuccessfully on ef2381c

Even after applying patch ,It was working as earlier. It is not showing extrat detail about template. Not able to upload screenshot about Same.


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

avatar Vineet7875 Vineet7875 - test_item - 22 Feb 2025 - Tested unsuccessfully
avatar Vineet7875
Vineet7875 - comment - 22 Feb 2025

I have tested this item 🔴 unsuccessfully on ef2381c

Even after applying patch ,It was working as earlier.


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

avatar SniperSister
SniperSister - comment - 22 Feb 2025

@shrutidhole123 @Vineet7875 the user interface will remain unchanged, only the available information in the mail layout renderer will change. Have you guys taken that into account?

avatar SniperSister SniperSister - change - 22 Feb 2025
The description was changed
avatar SniperSister SniperSister - edited - 22 Feb 2025
avatar SniperSister
SniperSister - comment - 22 Feb 2025

@shrutidhole123 @Vineet7875 I have updated the test instructions to get a visual confirmation that the patch works, could you please re-test?

avatar ceus1984 ceus1984 - test_item - 22 Feb 2025 - Tested successfully
avatar ceus1984
ceus1984 - comment - 22 Feb 2025

I have tested this item ✅ successfully on ef2381c

all the needed information appeard


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

avatar Sabine-2023 Sabine-2023 - test_item - 22 Feb 2025 - Tested successfully
avatar Sabine-2023
Sabine-2023 - comment - 22 Feb 2025

I have tested this item ✅ successfully on ef2381c

works great!


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

avatar alikon alikon - change - 22 Feb 2025
Status Pending Ready to Commit
avatar alikon
alikon - comment - 22 Feb 2025

RTC


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

avatar rdeutz rdeutz - change - 27 Feb 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-02-27 13:11:38
Closed_By rdeutz
Labels Added: Feature RTC
avatar rdeutz rdeutz - close - 27 Feb 2025
avatar rdeutz rdeutz - merge - 27 Feb 2025

Add a Comment

Login with GitHub to post a comment