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.
519 sites
15 fans

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.
Will there be a version of this block for Moodle version x.x?

If you'd like to use this block on a later version than the latest release says is supported, try it and see if it works.  There's usually no changes that would affect this block, so it's better to try it and let me know if there's a problem than to ask me if/when there will be an update.  I will do my best to test on new versions and update this page accordingly.

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.


Screenshot #0


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 adem özgür
    Fri, 28 Feb 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, 1 Mar 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, 5 Jun 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, 27 Dec 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, 19 Mar 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!
  • Picture of Priyanka Sinha
    Wed, 25 Nov 2015, 1:32 PM
    Nice plugin. Tested it and works fine on one of my installation on Moodle 2.7. When will this be available for Moodle 2.9? I have one more installation on Moodle 2.9 and would like to install it. Thanks!
  • Picture of Tim Bahula
    Fri, 5 Feb 2016, 11:33 AM
    Installed and working on my Moodle 2.9 dev server. I like it.
  • Picture of Dave Emsley
    Mon, 11 Apr 2016, 10:16 PM
    Thanks for that Tim Bahula. However if this is the case why can I not install direct from Moodle repository?
  • Picture of Olga Kim
    Thu, 16 Jun 2016, 7:03 AM
    works in moodle 3.1, thx!
  • Picture of Mark Johnson
    Fri, 17 Jun 2016, 4:11 PM
    Thanks Olga, I appreciate you trying it out and letting me know. I've updated the page to indicate support up to 3.1.
  • Picture of Andrew Barrett
    Thu, 15 Dec 2016, 8:59 PM
    Hi Mark, Thank you for a very useful plugin. Any sense of whether it works on 3.2?
  • Picture of Mark Johnson
    Thu, 15 Dec 2016, 9:18 PM
    Hi Andrew, I'm not currently using the block myself, so am unable to say. If you try it out, please let me know.
  • Picture of Andrew Barrett
    Sun, 15 Jan 2017, 2:14 AM
    Hi Mark, I'm experiencing some difficulties on moodle 3.2 (have tried with custom, clean and boost themes). I'm getting a 502 Bad Gateway message. Will open on Bug Tracker.
  • Picture of Jayden Tyronian
    Tue, 9 May 2017, 9:33 PM
    Hi Mark

    I have this working on our 3.1 site and working well. Just a couple of things I don't know if its possible to do:

    1) Is there a way to change the name that appears on the block?

    2) Is it possible to specify the colour to be used in the black name rather than the theme's default

    3) We want to list a few roles, but would like to be able to show in the block those roles. For example... Teacher (then the names of those in the Teacher role), Marker (then the names of those of those in the Marker role) etc.

    Thanks heaps, love the block smile
  • Picture of Mark Johnson
    Mon, 15 May 2017, 3:59 PM
    Hi Jayden,
    1) This isn't currently a configurable setting, but you could create a local override for the block_messageteacher "pluginname" string using Moodle's Language customisation feature
    2) I'm not sure exactly what you mean by "the black name" but the block uses the theme's defaults wherever possible to keep consistency with other blocks. Your theme may allow you to add custom CSS in its settings to override it.
    3) The roles that are displayed in the block are configurable in the plugin's settings.
1 2 3
Please login to post comments