Include course short name in Messaging

Include course short name in Messaging

by Hayk Zakaryan -
Number of replies: 0

Hi all,

I am trying to include the course shortname in Messaging system, mainly in history section, so that users(students) can determine the exact course that they received message from.

In the file message/history.php i am trying to retrive the valiable containing course shortname and then just concatenating it to $message before echo-ing it out, please see below

$courseID = $SESSION->cal_course_referer;
$courseFrom = filter_text(get_field('course','shortname', 'id', $courseID));

//concatenating $courseFrom to $message

 $message .= '<span style="color:grey">' . "(Course " . $courseFrom . ")" . '</span>';

This seems like working, but in history section of messaging, it always shows the short name of the current course the user is in(probably because i am getting the $courseID from $SESSION global) and not the shortname of the course that the message was sent from.

Any direction on how to achieve getting the shortname of the course the message was sent from?

I also tried using $courseID = required_param('id',PARAM_INT);

but did not work for me again.

Thanks in advance!

Hayk.

Average of ratings: -