Notifications related ro course requests (course requests, course request approvals, also course request rejections) are incorrectly handled as plain-text, badly affecting users' experience, especially via the WWW GU interface:
- Notifications are displayed surrounded with the "pre" tag that fails to wrap lines around, and use fixed-width fonts
- hyperlinks do not work even if languages strings such as the core "courserequestnotifyemail" string contain them as formatted a tags
I think the problem is that the protected function "notify" in the /course.lib.php file does not save any output into the "fullmessagehtml" column of the related DB table mdl_notifications.
Not sure this is all that's required to fix everything correctly, but on my sites - as a workaround fix - I have replaced the line:
$eventdata->fullmessagehtml = '';
with
$eventdata->fullmessagehtml = $message;
and am now receiving properly formatted HTML course request notifications - fonts, wrapping, and hyperlinking working correctly in them.
(In the said DB table mdl_notifications I now have exactly the same text entries in the "fullmessage" and "fullmessagehtml" columns. I am also not sure if the "$eventdata->fullmessageformat = FORMAT_PLAIN;" declaration in the notify function is the best or correct.)
While working on my workaround, I also spotted that the language string core_admin > courseapprovedemail2 string sent in course request approval notices applied merely {$a->url} for the created new course hyperlink, while the effective solution should (IMO) be <a href="{$a->url}">{$a->url}</a> . I have already filed a fix proposal for en_fix on the AMOS platform. (The course request string (core > courserequestnotifyemail) is already properly formatted for HTML notifications, using the "a" tag.)
Before my fix:
After my fix:
- will be (partly) resolved by
-
MDL-85346 Course request email contains unformatted/incorrect information
-
- Waiting for component lead review
-