Fresh install of Joomla 5.2.2.
Go to mailtemplates and open Contacts: Contact Form Mail
Do nothing and just save
Mail sent to admin contains contactform information
Mail sent to admin only contains language constant COM_CONTACT_ENQUIRY_TEXT
Joomla 5.2.2
PHP 8.2.12
Database entries for Global Configuration: Test Mail which stays ok upon save and entry for Contacts: Contact Form Mail where hmtlbody is wrong
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
First of all I'm using JCE editor, second I know how to solve it by creating my own hmtl body that works without problems.
I just reported this as a bug, because inexperienced users might open the email template and then save it and having this problem. So I think there should be made a fix.
My comment is correct and adressed to everyone who will ever will hit this issue in the future. There is no easy fix for it.
I do not see why you complaining.
jce is based on tinymce.
This is a bug which needs to be fixed
@brianteeman totally agree. I have enough knowledge to eiter remove entries from database or create my own html template, but this is not how it is supposed to work.
Same as this issue which has been reported multiple times. #44396
This is the TinyMCE issue, the same as #44396, it is how TinyMCE works.
We probably could force Codemirror for HTML editing for emails, similar as it done for template files editing.
Or have an option to change the editor for Email template, that could be a good solution.
@Fedik
With all due respect, this is of course complete nonsense. As you can see, and could have seen for yourself if you had bothered to test things, you could have seen that using JCE and customising html for mail to test email settings does work.
Furthermore, codemirror is anything but user-friendly and not suitable for inexperienced users.
There seems to be a lot of frustration here from your point of view @Pinkeltje. But with all due respect, this tone and the insinuations are completely unnecessary and missplaced. Many thanks, @Fedik, for your explanations and constructive suggestions on this issue. I think this will be very helpful for other people who unfortunately have to deal with the tooling themselves.
Back to the actual problem, as already mentioned, there is a conflict between the behaviour of the WYSIWYG editors, whether TinyMCE or JCE, and the creation of the templates when they are first saved.
I think the suggestion to force an editor such as CodeMirror is absolutely appropriate in this situation.
To be honest, I think this is absolutely sufficient, as an inexperienced user will probably end up very frustrated with the mail templates if he tries to style anything here, even with a WYSIWYG editor.
These editors are simply not designed for this and emails do not work 1:1 like an HTML page. In fact, an inexperienced user should not enter anything more than plain text here or use one of the countless free generators especially for emails in the www and then copy and paste directly here. This also ensures to some extent that the emails reach the recipients on all clients (Outlook, GMail, Thunderbird, etc.) and possibly in dark and light mode as the creator intended.
I think it's an even more frustrating experience for inexperienced users when they ‘build’ something here in painstaking work only to realise that it looks completely different on the recipients end.
OK. I'll stop reporting bugs, though. I am apparently not taken seriously and assumptions are being made here without bothering to test.
@Pinkeltje please dont stop reporting bugs. What you identified is a bug and it not correct to say that it can only be fixed by changing to use codemirror.
@LadySolveig it is NOT about styling the message to look like a web page but some simple markup such as even a bold tag
thats a configuration option
@brianteeman I would like to see that :)
OK. I'll stop reporting bugs, though. I am apparently not taken seriously and assumptions are being made here without bothering to test.
Too bad reporting bugs is one of the biggest gifts for this project to stay alive. I really appreciate your commitment @Pinkeltje !
Nevertheless, respectful behaviour is at least as important to move forward.
@brianteeman There are always several solutions to a problem. Fedir has so far been the only one to make a constructive suggestion. If, as you say, it is possible to configure this differently for TinyMCE in particular for the mail templates, then perhaps we could implement this in the CMS. However, this would probably not solve the issue for the creator? As he has pointed out that he installs and want to use JCE.
The problem is that the language constant should NOT be displayed in the html editor - it should be the language value. If you enable language debug then you will see that the language string is not found because it is looking for the langauge string in the ADMIN language file but the language string is only present in the SITE language file
I am not sure if the best solution is to add the string to the admin language file OR if the com_mails component should be updated to look in both the site and the admin files.
If you look at the function
you will see that it is only ever loading the admin language files!!You do not see the reported problem in any of the mail templates because they are all admin language strings as a super quick check would have shown
This is NOTHING to do with the editor being used and NOTHING to do with the editor wrapping strings in the html black element p
As further confirmation that this is nothing to do with the html editor the exact same problem for the exact same reason exists for the com_contact mail templates when using PLAINTEXT
Okay, then it is not an editor issue, thanks for checking.
I remember in past it was shown a language constant, untill user push some button. It seems I missed this change.
would have saved upset if both you and @LadySolveig had actually looked at it before replying - but moving forward I am not sure on the best way forward.
@Pinkeltje as a quick fix for yourself you can add these two lines to administrator\language\en-GB\com_contact.ini
COM_CONTACT_ENQUIRY_SUBJECT="{SITENAME}: {SUBJECT}"
COM_CONTACT_ENQUIRY_TEXT="This is an enquiry email via {URL} from:\n{NAME} <{EMAIL}>\n\n{BODY}\n\n{CUSTOMFIELDS}"
I can take a deeper look into this next week.
@brianteeman
Seems to be a missing language constant indeed. Added your constants to language overrides and now it works. But as said before, I just wanted to report the bug. We had this problem reported by a user on our Dutch Joomla forum. I already gave the solution to paste this in the code field of the html template, and that worked also:
<p>Dit is een aanvraag van: {NAME}</p>
<p>E-mail: {EMAIL}</p>
<p>Onderwerp: {SUBJECT}</p>
<p>Inhoud bericht: {BODY}</p>
<p>Via: {URL}</p>
<p>{CUSTOMFIELDS}</p>
@zero-24 Thanks for looking into it.
@Fedik and @LadySolveig
To show that it has nothing to do with the editor. This works like a charm:
I think this should be an easy fix contrary to the fix for #44396
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-13 22:38:06 |
Closed_By | ⇒ | zero-24 |
Hi, please take a look into this PR: #44730
As there is a PR i will close this issue here. Thanks.
I think this should be an easy fix contrary to the fix for #44396
Yes thats more complicated. Could be solved by letting the strings beeing edited with an editor but I'm sorry will not have the time to dig deeper into that Issue.
That happen because TinyMCE forces every content to be inside a tag, and so it wrap the default text in to
<p>
when you opened it first time.As work around:
Change editor to Codemirror (in global configuration), and edit that email template again, where remove
<p>
tag