? NPM Resource Changed ? ? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
22 Apr 2021

Pull Request for Issue #27619.

Summary of Changes

This PR makes some improvements to Mail Templates to make it easier to use (I hope :D ). Below are the changes (base on suggestions from #27619)

  1. Link Title column to edit mail template of the default language
  2. Remove Templates and No Templates columns
  3. On a site with multiple content languages, add Edit Templates column to allow click on to edit mail template of a specific language
  4. Remove switcher, show actual mail template content instead of just language item
  5. Add Reset To Default to allow reset to default subject, body and html body of a mail template
  6. Replace Available Tags with Insert Tags
  7. Show Default Content For HTML Body (base on body with nl2br method applied) if there is no data for HTML Body from master template

Below are some screenshot to show the changes:

  • Mail Templates on a single/mono language
    mono-language

  • Mail Templates on multiple languages
    multiple_languages

  • Edit Mail Template of a language
    edit_mail_template

Testing Instructions

Download update package for this PR at https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/33230/downloads/42268/Joomla_4.0.0-beta8-dev+pr.33230-Development-Update_Package.zip, go to System -> Update -> Joomla to update. Then try to use Mail Templates to see if it is working OK. Hopefully it is easier to use than the default implementation.

b53500f 22 Apr 2021 avatar joomdonation CS
avatar joomdonation joomdonation - open - 22 Apr 2021
avatar joomdonation joomdonation - change - 22 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2021
Category Administration Language & Strings JavaScript Repository NPM Change
cd4175c 22 Apr 2021 avatar joomdonation CS
avatar joomdonation joomdonation - change - 22 Apr 2021
Labels Added: ? NPM Resource Changed ?
avatar brianteeman
brianteeman - comment - 22 Apr 2021

I think you're going to have to change the button names "reset to default" so that it is clearer what they refer to. eg body and message

avatar brianteeman
brianteeman - comment - 22 Apr 2021

And there are now three language strings that can be removed as the fields they refer to are no longer present

avatar brianteeman
brianteeman - comment - 22 Apr 2021

First impressions are great - massive massive improvement

avatar joomdonation
joomdonation - comment - 22 Apr 2021

First impressions are great - massive massive improvement

Thanks for the feedback. Assume this PR is in right direction, I will work on further clean up and improvements.

avatar brianteeman
brianteeman - comment - 22 Apr 2021

Great - let me know when its ready for full testing

92d8804 22 Apr 2021 avatar joomdonation CS
avatar joomdonation
joomdonation - comment - 22 Apr 2021

@Quy Please help committing the suggested changes yourself. Many thanks !

avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2021
Category Administration Language & Strings JavaScript Repository NPM Change SQL Administration com_admin Postgresql Language & Strings JavaScript Repository NPM Change Installation
avatar joomdonation
joomdonation - comment - 22 Apr 2021

My last commit added a new column extension column to #__mail_templates table. The only improvement from this commit is that it allows hiding mail templates from disabled extensions from Mail Templates management screen. Do you think this is useful/needed? If not, I will revert that commit.

avatar richard67
richard67 - comment - 22 Apr 2021

My last commit added a new column extension column to #__mail_templates table. The only improvement from this commit is that it allows hiding mail templates from disabled extensions from Mail Templates management screen. Do you think this is useful/needed?

I think that could be useful, but I am not the expert. @Hackwar What do you think?

avatar brianteeman
brianteeman - comment - 22 Apr 2021

Applied the PR and then the database fix
Opened the component and it said No results
Verified that the database table still exists
Tried to use the search filter and selected my one language (english) and got the following 500 error

500 Column 'extension' in IN/ALL/ANY subquery is ambiguous Column 'extension' in IN/ALL/ANY subquery is ambiguous

avatar joomdonation
joomdonation - comment - 23 Apr 2021

@brianteeman Thanks for testing. It was too late for me last night and I did not test my last commit carefully enough. I planned to do final test myself today before pinging you for testing but you were too fast :).

Back to the issue:

  1. The no results error, I guess it is because one SQL command is not executed when you use database fix. Please run the SQL commands below to your database then try again, it should solve the issue (of course #__ should be replaced with table prefix used for your site)
UPDATE `#__mail_templates` SET `extension` = SUBSTRING(`template_id`, 1, POSITION('.' IN `template_id`) - 1);
  1. The error 500 when select a language is a bug. I fixed it. Please re-apply the patch and test it again. Thanks.
avatar brianteeman
brianteeman - comment - 23 Apr 2021

It was late for me too or I would have spotted the problem as the query was not structural. ;)

avatar brianteeman
brianteeman - comment - 23 Apr 2021

The Reset buttons don't appear to do anything

avatar brianteeman
brianteeman - comment - 23 Apr 2021

image

I guess break-word is the wrong class

avatar brianteeman
brianteeman - comment - 23 Apr 2021

Other than those small things this is much more usable - thank you very much - you're a superstar

avatar joomdonation
joomdonation - comment - 23 Apr 2021

@brianteeman Thanks for testing and giving feedback

  1. For break-word class, it was inherited from original code. I remove the class for now
  2. For reset buttons, I can only guess that happens because the change to js file is not applied yet? I'm not sure how you applied the patch, maybe you need to run npm ? I usually test it by download and install update for these kind of PRs.

Maybe you can get this zip file, unzip it media folder on your Joomla installation and try again? It contains the complied js files for this PR which I get from update package

com_mails.zip

avatar joomdonation joomdonation - change - 23 Apr 2021
Labels Added: ?
avatar brianteeman
brianteeman - comment - 23 Apr 2021

Sorry I forgot to run npm when i switched branches. The reset buttons work as intended

avatar joomdonation
joomdonation - comment - 23 Apr 2021

Sorry I forgot to run npm when i switched branches. The reset buttons work as intended

Great. Thanks for confirming.

avatar brianteeman brianteeman - test_item - 23 Apr 2021 - Tested successfully
avatar brianteeman
brianteeman - comment - 23 Apr 2021

I have tested this item successfully on e9cbb43


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

avatar joomdonation joomdonation - change - 23 Apr 2021
The description was changed
avatar joomdonation joomdonation - edited - 23 Apr 2021
avatar joomdonation joomdonation - change - 23 Apr 2021
The description was changed
avatar joomdonation joomdonation - edited - 23 Apr 2021
avatar alikon alikon - test_item - 23 Apr 2021 - Tested successfully
avatar alikon
alikon - comment - 23 Apr 2021

I have tested this item successfully on e9cbb43


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

avatar richard67 richard67 - change - 23 Apr 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 23 Apr 2021

RTC


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

avatar rdeutz rdeutz - close - 23 Apr 2021
avatar rdeutz rdeutz - merge - 23 Apr 2021
avatar rdeutz rdeutz - change - 23 Apr 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-04-23 09:30:56
Closed_By rdeutz
Labels Added: ? ?
Removed: ?
avatar joomdonation
joomdonation - comment - 23 Apr 2021

Thanks everyone !

Add a Comment

Login with GitHub to post a comment