MDL-64571 core_message: Fix duplicate footer in msg notification email
authorcescobedo <carlos.escobedo@gmail.com>
Mon, 11 Feb 2019 23:43:21 +0000 (00:43 +0100)
committercescobedo <carlos.escobedo@gmail.com>
Mon, 11 Feb 2019 23:43:21 +0000 (00:43 +0100)
lib/classes/message/manager.php
message/lib.php

index 774a590..5440a58 100644 (file)
@@ -159,8 +159,7 @@ class manager {
 
             $s = new \stdClass();
             $s->sitename = format_string($SITE->shortname, true, array('context' => \context_course::instance(SITEID)));
-            // When the new interface lands, the URL may be reintroduced, but for now it isn't supported, so just hit the index.
-            $s->url = $CFG->wwwroot.'/message/index.php';
+            $s->url = $CFG->wwwroot.'/message/index.php?id='.$eventdata->userfrom->id;
             $emailtagline = get_string_manager()->get_string('emailtagline', 'message', $s, $recipient->lang);
 
             $localisedeventdata->fullmessage = $eventdata->fullmessage;
index 474b274..801ebdd 100644 (file)
@@ -348,19 +348,6 @@ function message_post_message($userfrom, $userto, $message, $format) {
 
     $eventdata->fullmessageformat = $format;
     $eventdata->smallmessage     = $message;//store the message unfiltered. Clean up on output.
-
-    $s = new stdClass();
-    $s->sitename = format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID)));
-    $s->url = $CFG->wwwroot.'/message/index.php?user='.$userto->id.'&id='.$userfrom->id;
-
-    $emailtagline = get_string_manager()->get_string('emailtagline', 'message', $s, $userto->lang);
-    if (!empty($eventdata->fullmessage)) {
-        $eventdata->fullmessage .= "\n\n---------------------------------------------------------------------\n".$emailtagline;
-    }
-    if (!empty($eventdata->fullmessagehtml)) {
-        $eventdata->fullmessagehtml .= "<br /><br />---------------------------------------------------------------------<br />".$emailtagline;
-    }
-
     $eventdata->timecreated     = time();
     $eventdata->notification    = 0;
     return message_send($eventdata);