Your Moodle version

Blocks: Message My Teacher

Maintained by Picture of Mark Johnson Mark Johnson
This block allows configuration of roles to be considered "Teachers" of a course. The block will then display a list of these teachers for the current course in the block, with a link to message each one.

This block displays a list of all Teachers for the current course page (except for the current user, if they are a teacher).  Each name links to the messaging system allowing the user to quickly message their teacher.

The roles that are considered to be "Teachers" can be configured, allowing control over who is actually displayed in the block.

New in 2.3

  • Modal form allows students to send messages without leaving the current page.
  • New option to automatically append current page URL to messages.

Development of version 2.3 was sponsored by Connecting Waters Charter School (

 Development of Group support and User Picture support was sponsored by by Proud Photography ( – Online Photography School.

Please dont report bugs here

If you experience an error with the block, or would like to request a feature, please use the "Bug Tracker" link below.




Picture of Mark Johnson
Mark Johnson (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Andrew Solomon
    Wed, Feb 13, 2013, 7:17 AM
    I've installed it on Moodle 2.3 and I'm having the same problem as Logan
  • Picture of Chris Simpson
    Thu, Apr 18, 2013, 11:17 AM
    does site wide messaging have to be enabled? i would like student to be able to message teachers but not each other and i thought this maybe able to complete this? Thanks
  • Picture of Jay Salgado
    Mon, Apr 22, 2013, 7:22 AM
    How can I change the title of the block? I use "Tutors" instead of "Teachers" but I don't find the way to change this. I modified the php in the language folder and also introduced $string['blockname'] = 'Message the tutors'; but it is not working. Do you know how to change the title of this particular plug in? Thank you :D
  • Picture of Mark Johnson
    Mon, Apr 22, 2013, 4:18 PM
    Your site's Message system will need to be enabled for this block to do anything useful - all it really does is display a link to certain users' Message pages.

    Please refer to this issue on the tracker:
  • I like cats
    Thu, Jun 20, 2013, 7:51 PM
    I'm getting an error trying to upgrade to this latest version:
    Unknown error upgrading block_messageteacher to version 2013031301, can not continue.
    Debug info:
    Error code: upgradeerror
    Stack trace:

    line 249 of /lib/upgradelib.php: upgrade_exception thrown
    line 821 of /lib/upgradelib.php: call to upgrade_block_savepoint()
    line 362 of /lib/upgradelib.php: call to upgrade_plugins_blocks()
    line 1544 of /lib/upgradelib.php: call to upgrade_plugins()
    line 349 of /admin/index.php: call to upgrade_noncore()

    Moodle version is Moodle 2.4 (Build: 20121203)

    I'm going to just remove the block and upgrade to Moodle 2.5 anyway, and when I've got that done and tested I'll try this block again, but I thought I should at least point out the issue. We had been using the previous version of the block, which had no problem.
  • I like cats
    Thu, Jun 20, 2013, 8:38 PM
    Followup. Upgraded to Moodle 2.5, reinstalled the block, and it went in fine. Perhaps an issue with that particular build of Moodle 2.4 that I was using?
  • Picture of Mark Johnson
    Thu, Jun 20, 2013, 8:43 PM
    Hi Tony,
    Thanks for your report, I have found this and fixed it locally but not yet released the fix. I've added your report to the issue tracker with more infomation:
  • Picture of Guido Roessling
    Mon, Jun 24, 2013, 12:41 AM
    Just a small recommendation: adding a " ORDER BY u.firstname ASC, u.lastname" to the query in line 68 of blocks_messageteacher.php makes a longer list far easier to scan (our course has 20+ tutors, so this is relevant). Otherwise - good job!
  • Picture of Mark Johnson
    Mon, Jun 24, 2013, 1:14 AM
    Tony, the newly released version 2.2.2 fixes the upgrade bug.

    Guido, thanks for the suggestion, it's also in the new release!
  • -
    Sat, Aug 10, 2013, 3:54 PM
    How can I quit the default name plugin "MESSAGE MY TEACHER", to none or change? we speak in other language.
  • Picture of adem özgür
    Fri, Feb 28, 2014, 1:06 AM
    Hi Mark, could you publish this for moodle v2.6, i want to use like this block for sent message all teachers in a course (like Ask your teachers) in my thesis.
    or how can i apply this for moodle 2.6?
  • Picture of Mark Johnson
    Sat, Mar 1, 2014, 4:48 PM
    Hi adem
    As far as I'm aware the block should work with 2.6, but if you get an error when you try to use it please let me know and I'll try to fix it.
  • Picture of Sarah Cotton
    Thu, Jun 5, 2014, 11:13 PM
    In 2.6 I noticed an error in the php log to do with the extra userfields in the user object:
    PHP Notice: Missing firstnamephonetic property in $user object, this is a performance problem that needs to be fixed by a developer.
    this was fixed by simply adding them into the query on line 59 of block_messageteacher.php
    The extra fields are: u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename
    Hope this helps
  • Picture of Steven Swanson
    Sat, Dec 27, 2014, 1:02 PM
    Thanks for the plugin! Very easy to use. I am using it on 2.6 and it works great. Here is a respectful recomendation of the next version: When students write the message and push "send", it takes a second or two for it to complete. Students will often push it again. This results in multiple duplicate messages being sent. This is no fault of the plugin, but can be fixed in the code so not to allow multiple functional clicks. Mean while, I added a little code that says "click only once.... it takes a second".
  • Picture of Georg Wiesinger
    Thu, Mar 19, 2015, 10:55 PM
    A really nice plugin! I tested this block on Moodle 2.8.5 and did not came across any problems so far. I like it!
1 2
Please login to post comments