User tests: Successful: Unsuccessful:
Pull Request resolves #29169
Currently when a user sends a private message, the system tries to send an email notification. If the mailer fail (eg due to SMTP issues or mail disabled), the entire save operation returns false. This triggers a red Save failed error in the UI even tho the message is saved to the db and sent to recipient . This leads to confusion.
so I adjusted com_messages save flow so message creation is not marked as failed when only the mail notification fails
In ../Model/MessageModel.php
Removed model hard-failure path both setError + return false in the mail send exception block after the message has already been stored.
Kept a warning COM_MESSAGES_ERROR_MAIL_FAILED
logged technical mail exception details to com_messages log category instead of jerror to avoid showing raw SMTP mail errors.
configure a local environment where mail sending should fail (use invalid SMTP host).
go to System > Global Configuration > Server tab.
godown to Mail Settings.
Set send Mail to Yes.
Set mailer to SMTP.
Set SMTP Host to something (fake) like 127.0.0.1 and Port to 25.
now save and close
go to administrator, open users -> messaging -> Private Messages.
Create(click new) and send a new private message to any user
now login as the user whom you sent the private message in inbox you see the message. (but when you sent the message you only got the error and warning)
It tells you that yes the message is sent and gives warning about the email.
you can also test :
when Mail is explicitly disabled
Global configuration -> server -> Send Mail = No.
now Send a private message.
Verify:
Message is still saved (success banner shown).
Warning is shown about email.

also
when No false save failure.
configure a working SMTP - I tested this using (https://ethereal.email/ & laragon mailpit)
Send a private message.
Verify:
Only success banner is shown.
No warning banner.
Notification email is received in the SMTP inbox.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_messages |
Expected result AFTER applying this Pull Request
@krishnagandhicode Do you rally think that makes sense, first message telling that the email could not be sent, and 2nd message telling it was sent?
Or did you maybe mix up the screenshots for the actual and the expected result?
The actual result should describe what happens without this PR, and the expected result should describe what happens with this PR.
The green Message sent banner refers to the internal Joomla's private message being successfully stored in the database(received by receiver). The yellow The email could not be sent banner refers to the external email notification failing
Expected result AFTER applying this Pull Request
@krishnagandhicode Do you rally think that makes sense, first message telling that the email could not be sent, and 2nd message telling it was sent?
Or did you maybe mix up the screenshots for the actual and the expected result?
The actual result should describe what happens without this PR, and the expected result should describe what happens with this PR.The green Message sent banner refers to the internal Joomla's private message being successfully stored in the database(received by receiver). The yellow The email could not be sent banner refers to the external email notification failing
@krishnagandhicode I see. Still confusing at a first look.
Another thing: Now the reason for the email notification error is only in the log file, e.g. the SMTP error. I'm not sure if that is a good idea. Let see if opinions come in.
The strings need to be modified to be clearer
Perhaps
SMTP Error: The mail could not be sent
The message is available in the users Control Panel
| Labels |
Added:
bug
PR-5.4-dev
|
||
| Category | Administration com_messages | ⇒ | Administration com_messages Language & Strings |
I have tested this item ✅ successfully on c6d5bdd
I have successfully tested this. Even sent a message to a user with multiple access levels - worked!
Thanks @krishnagandhicode!
I have tested this item ✅ successfully on c6d5bdd
| Status | Pending | ⇒ | Ready to Commit |
| Status | Ready to Commit | ⇒ | Pending |
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Labels |
Added:
RTC
Language Change
|
||
Would it not be less confusing if you only got one message and not two
But with this PR we lose that useful information
That’s true, and it should be looked into again.
@krishnagandhicode could you please have a look at this? Thanks.
I agree. The confusing thing which should be fixed is the "Save failed ..." despite of the message being saved.
But this PR here now causes a loss of important information.
Back to pending.
| Status | Ready to Commit | ⇒ | Pending |
Thanks - I am looking into it.
Maybe just change the second message from
Save failed with the following error: %s
to
Email could not be sent with the following error: %s The message is available in the Joomla administrator
I total agree with the issue that the red UI-error Save failed with the following error: The email could not be sent. gives the wrong signal as the message is stored and delivered to the user as Joomla private message.
I am afraid of the green UI-note Private message is sent. I guess most users will not differentiate between email message and Joomla private message. And they are getting confused is the email sent or not.
Email could not be sent: %sThe user can view the message in Joomla administrator Private Messages.Message sent. may say too little? Provide more details?The message is sent as email and the user can view the message in Joomla administrator Private Messages.@brianteeman and @chmst what are you thinking?
- Green Notice:
The user can view the message in Joomla administrator Private Messages.
or:
Private Message sent to user's Joomla Administrator Private Messages
Or:
Private Message sent to user's Administrator Private Messages
Or:
Private message successfully saved to the Recipient's Private Inbox
- Green Notice:
The message is sent as email and the user can view the message in Joomla administrator Private Messages.
maybe this is bit confusing because It says: message is sent as email and/but can be viewed by user in user's Joomla administrator Private Messages.
Would love to see what others think/say : )
The option shown here #47413 (comment) works for me
Its not perfect but I dont think this is something that can ever be perfect and its better than it is currently
| Labels |
Removed:
RTC
|
||
Updated.
I have tested this item ✅ successfully on 65ae849
I have re-tested this successfully. Thanks @krishnagandhicode for the perseverance.
Discussed between the release managers: ✅ We have decided on the current implementation as it eliminates the main source of confusion in the user experience.
Hmm, theoretically this is a change of the language string COM_MESSAGES_ERROR_MAIL_FAILED which can be done only in a new minor release after (change of meaning or change of sprintf parameters, here the latter). So it would need to add a new string with a new key and deprecate the old string and so on.
Or can we be 100% sure that this string is only used by the core?
The rules on changing the meaning of language strings are clear. This would need to be a new strings as the changes are substantially different in meaning
Agreed.
I will keep COM_MESSAGES_ERROR_MAIL_FAILED unchanged to preserve existing meaning, and add a new string maybe COM_MESSAGES_ERROR_MAIL_FAILED_REASON with a %s placeholder for the specific mail error reason used in this PR.
Is that alright ?
Agreed. I will keep COM_MESSAGES_ERROR_MAIL_FAILED unchanged to preserve existing meaning, and add a new string maybe COM_MESSAGES_ERROR_MAIL_FAILED_REASON with a %s placeholder for the specific mail error reason used in this PR.
Is that alright ?
@krishnagandhicode Yes, that looks good.
@krishnagandhicode P.S.: You could also check if the old string COM_MESSAGES_ERROR_MAIL_FAILED is still used somewhere. If that is not the case and it's unused, you can add a comment line above it with a deprecation comment. But if not 100% sure, leave it as it is without a deprecation comment.
I have tested this item ✅ successfully on 8e2670f
@krishnagandhicode P.S.: You could also check if the old string
COM_MESSAGES_ERROR_MAIL_FAILEDis still used somewhere. If that is not the case and it's unused, you can add a comment line above it with a deprecation comment. But if not 100% sure, leave it as it is without a deprecation comment.
checked for COM_MESSAGES_ERROR_MAIL_FAILED is not used in code anymore so added a deprecation comment.
I have tested this item ✅ successfully on 8e2670f
@dautrich Have you tested with the latest changes (new string COM_MESSAGES_ERROR_MAIL_FAILED_REASON instead of changed string COM_MESSAGES_ERROR_MAIL_FAILED? O'm asking because your test came very quickly after that change, so I think maybe you have tested the previous version.
@richard67
I didn't check for the language strings at all. It took me some time to set up my environment. Therefore I assume that I tested before the language strings were changed.
How can I check the language strings?
How can I check the language strings?
@dautrich Just test again with the new prebuilt packages or by applying the PR again. You can check if the administrator/language/en-GB/com_messages.ini file contains the changes shown here: https://github.com/joomla/joomla-cms/pull/47413/changes#diff-dbf9e295e3d9d1a1e10bd7fd303682bb0e519ef90cb8554903bc32d13127a99c
I have tested this item ✅ successfully on 685155b
- Tested with Patchtester, also the optional tests
I have tested this item ✅ successfully on 685155b
I have successfully restested this. Thanks @krishnagandhicode!
| Status | Pending | ⇒ | Ready to Commit |
RTC
@krishnagandhicode Do you rally think that makes sense, first message telling that the email could not be sent, and 2nd message telling it was sent?
Or did you maybe mix up the screenshots for the actual and the expected result?
The actual result should describe what happens without this PR, and the expected result should describe what happens with this PR.