MDL-53674 event monitor: Do not send HTML as plain text formatted emails
authorDavid Mudrák <david@moodle.com>
Thu, 31 Mar 2016 13:42:06 +0000 (15:42 +0200)
committerDavid Mudrák <david@moodle.com>
Fri, 8 Apr 2016 13:14:23 +0000 (15:14 +0200)
commitdb1d5b104b4151388744161975ec619961ed2bbb
treee97fe4eb2733f531ab57dc4fd6b7a2055376a050
parentb611ade3abc7f19341db866a2d9c31f53909ba8e
MDL-53674 event monitor: Do not send HTML as plain text formatted emails

There were two problems here.

* The $msgdata->fullmessage was always formatted as HTML even if the
  $msgdata->fullmessageformat was set to the original template's format.
* The plain text part of the emailed message contained HTML code.

The patch makes sure that the original template is always formatted into
HTML and then converted to plain text before setting the text/plain
multipart of the sent email.
admin/tool/monitor/classes/notification_task.php
admin/tool/monitor/tests/eventobservers_test.php