Message My Teacher

Blocks ::: block_messageteacher
Maintained by 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.
Latest release:
1179 sites
44 fans
Current versions available: 4

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.5

  • Major re-write for Moodle 3.7 compatibility.

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


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

Comments RSS

Show comments
  • Mon, May 15, 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.
  • Fri, Jun 9, 2017, 1:09 AM
    Hi Mark,
    Your block is really usefull and easy to install, althought i'm getting problems about config it.
    A internal moodle's chat is open after the students sent me a message, (and also i recive a redirected personal email) but, how I can respond directly by email? avoiding using the internal moodle's chat.
    Because when i try it, in my email i can't see the student's email address who sent the message by "block_messageteacher" i can only see his student name, and like "destination email address"
  • Fri, Jun 9, 2017, 3:56 PM
    Hi Ivan,
    The block just uses Moodle's messaging API to send the message, I'm afraid it doesn't deal with how the use recieves or responds to the message, that will be part of the configuration of the core messaging system.

  • Fri, Jun 9, 2017, 7:04 PM
    Hi Mark

    Thank you for getting back to me. Sorry 2 above black... should have been block, but you understood what I was asking so that's ok.

    A couple additional items hopefully you can help with.

    1) The message that is sent to the teacher includes the URL of the course the student is sending the message on (which is awesome). Is there any way to include in the subject and/or message to include the ID Number field from the students profile?

    2) Same sort of question as above, however is it possible to include the Course details the code/name as used when setting up the course i.e. ABC 101 or ABC 101 Test Course with or without any custom additional text to go with that?

    3) Is it possible to separate the list of teachers by role and have that role name heading appear i.e. Teacher then underneath Joe Bloggs, Marker then underneath Jane Doe etc.

    Thanks heaps.
  • Fri, Jun 9, 2017, 7:32 PM
    Hi Jayden,
    I'm afraid none of those features are currently supported in the block.

  • Tue, Jul 18, 2017, 11:57 AM
    hi mark,
    teachers that get the mail does not understand that they need to answer with moodle massaging ,is it possible to add explanation notice field -
  • Tue, Dec 12, 2017, 6:47 AM
    I really like this block. I'm currently using it on Moodle 3.4. Using the Adaptable theme the block shows the Teacher in a bulleted list and I was wondering where in the CSS or elsewhere I could change this setting to show the teachers in a regular list? No bullet or indentation... thanks!
  • Sat, Apr 28, 2018, 2:20 AM
    This is a great block - thank you!! I would like the student's email address to be shown in the "Reply to" field in the message that is received by the teacher. At the moment it is picking up the default email address from Moodle which means the teacher cannot automatically reply to the student but has to log in to Moodle to send a message. Is there any easy way to achieve this? I would also like a copy to be BCC'd to our admin email address but again cannot see how to achieve this.

    Thanks! Nikki
  • Mon, Apr 30, 2018, 4:31 PM
    Hi Nikki,
    The block just uses Moodle's messaging system, so will use the available messaging outputs as they are enabled/configured for the rest of the system. There's nothing in the plugin to control how (or indeed if) emails are sent.
  • Wed, Jun 13, 2018, 1:03 PM
    Hi Mark,

    I have an unusual problem. For most students the messaging block appears fine. For a small number though (it seems completely random) it shows them as not being assigned a teacher even though there is a teacher in their group. This happens for all the courses for that student. If I go into the group of ONE course, remove the student from the group, then immediately add them back in, it now correctly shows the teacher for ALL of their courses. I have checked the groups_members table in case there is something wrong like being in the same group twice (in case there was some corruption as some point) but there is nothign wrong with that table. I put debugging on and the SQL that is all fine. I cannot understand why it shows no teachers in their group but if I remove them from one group and place them back in it shows correctly for all courses. Any suggestions?

    Also, thanks for the info on messaging outputs.

    Thanks! Nikki
  • Wed, Jan 23, 2019, 5:57 PM
    Hi Mark thanks for the time on this block.

    I am using 3.6 and have the block installed but there seems to be some issues.

    The block seems to function as normal up to the point I click send, the dialog box shrinks but does not completely disappear. I am only trying the send the word test so there should not be a get deal of lag.

    The message never appear in the messaging system nor does it get delivered. Using the message system independent of the block has no problems with delivery. Any thought on this??
  • Fri, Jun 14, 2019, 3:45 AM
    I am having the same problem as Chris Simpson. Any insight would be appreciated!
  • Wed, Dec 4, 2019, 2:15 PM

    Exception - Argument 1 passed to message_send() must be an instance of core\message\message, instance of stdClass given, called in [dirroot]\blocks\messageteacher\message_form.php on line 89
  • Thu, Dec 5, 2019, 7:57 PM
    Musassar, this should be fixed in version 2.5 of the plugin. If you are using this version and there is still an error, please raise an issue on GitHub.
  • Sat, Dec 5, 2020, 3:10 AM
    Good plugin, when can it be available for version 3.10?
1 2 3
Please login to post comments