Permalink
Browse files

MDL-29814 message: made html personal messages also store a plain tex…

…t version as a fallback
  • Loading branch information...
andyjdavis committed Nov 19, 2011
1 parent f08f22c commit 9694f1c11407f2d323a23760720e2532b1ffec44
Showing with 3 additions and 1 deletion.
  1. +3 −1 message/lib.php
View
@@ -2011,8 +2011,10 @@ function message_post_message($userfrom, $userto, $message, $format) {
$eventdata->subject = get_string_manager()->get_string('unreadnewmessage', 'message', fullname($userfrom), $userto->lang);
if ($format == FORMAT_HTML) {
- $eventdata->fullmessage = '';
$eventdata->fullmessagehtml = $message;
+ //some message processors may revert to sending plain text even if html is supplied
+ //so we keep both plain and html versions if we're intending to send html
+ $eventdata->fullmessage = html_to_text($eventdata->fullmessagehtml);
} else {
$eventdata->fullmessage = $message;
$eventdata->fullmessagehtml = '';

0 comments on commit 9694f1c

Please sign in to comment.