Showing results for 
Search instead for 
Did you mean: 
Surveyor II

Messaging Observers of Students in Canvas

Hi All,

We've put together a script here at Strath to allow us to send messages to the observers of students from the Canvas Inbox (Conversations) and Marksbook ('Message Students Who...') pages. We're a K-12 institution, so while the ability to send messages to students who have not submitted their assignments is awesome, sometimes we need to let their parents know too! It looks a little something like this:


It's pretty simple. The script inserts some buttons on the 'Message Students Who...' and Inbox 'Send Message' buttons for inserting observers and removing students. Once clicked, the script does a few API calls in the background to determine who the observers of the students are and pops them in the recipient list.

Our CSM mentioned this might be something that other institutions might be interested in, so I've made the script and some instructions available here:

If you decide to give it a crack, I'd be interested to hear how it goes! I've tested this with a demo Canvas instance and it's worked ok, but that's the extent of my testing.

All the best!


Download v0.07 Here:



Version 0.07 on 17/04/20

  • Fixed issue where conversations (Inbox) recipients would become invalid after a recipient was removed.

Version 0.06 on 11/10/17

  • Added support for courses with more than one hundred enrolments.

Version 0.05 on 07/07/17

  • Added auto tick "Send an individual message to each recipient" function. This behaviour is active by default, but can be disabled in the msgobs options.

Version 0.04 on 06/07/17

  • Fixed issue where multiple course enrolment lookups were made for the same course in account admin mode.

Version 0.03 on 03/07/17

  • Added support for any kind of group in the recipient list.

Version 0.02 on 15/03/17

  • Fixed issue with unescaped message content.
  • Prevented clicking Remove Students while Include observers function is running.
  • Added dialog to preserve message content if sending fails in Gradebook function.

Version 0.01 on 20/09/16

  • Initial Release
30 Replies

Done Joe, just for you! You can download 0.05 with the change you suggested here (as usual) It is actually a really good idea; we've had a small debacle around that checkbox in the past. So thanks, that's helpful for us too, and no worries!

One more thing Joe which you may soon encounter, as we did, is this issue mentioned here:".... What happens is that Canvas sometimes determines that a user's communication channel is bouncing email messages and stops sending email notifications to that address without any notification to admins (the user is notified, but only when they log in to canvas). This will include of course your nicely created observer messages. Make sure you give that issue an upvote Smiley Wink

My workaround is the use of another script which at night crawls through every user in our Canvas instance, masquerades as them and then checks to see if that user has the notification that one of their email channels is not working. It then sends us an email about those accounts which aren't receiving emails anymore and we give them a ring.

Weirdly, although the canvas documentation (Canvas Production Release Notes (2015-04-25)  see Notifications heading) on this issue says that full mailboxes and other temporary problems are not supposed to be flagged, we found that when I first ran this script there were about 13 users with bouncing email flags, but only 2 were actually bouncing when we sent them a regular email. What I figured from this situation was that temporary issues had been flagged (bills not paid?), and if Canvas had just tried to send an email notification again, everything would have been fine. 

Bit annoying when you want to rely on Canvas for parent teacher communications, but I think we're on top of it with the nightly check. There were some other solutions put forward on the ideas page, so you may want to consider checking out whether they'll work easily for you. I haven't really looked at them yet. I'm of course happy to share this script, but it's a little on the hairy side haha. It would require node.js installed on a server, and installing a few packages with NPM. 

All the best and I'm glad you've been able to make use of the script!

Learner II

Thank you for sharing this script!

No worries, Martha! My pleasure.

Community Member

Hi Stephen, We installed the code your wrote for the Messaging of Observers and it has been working great.  Recently we received a support call from one teacher who it does not work for, and we can't figure it out.  I've attached a screen shot.  It works in this teacher's Inbox, but not in the Message Students Who.   There does not appear to be anything different about this teacher's course than any of the others that do work.  All others we've checked are working fine.  I wanted to see if you have any ideas on why it may not work for this one or things we should look at?

254513_Messaging Observers.jpg

Hi Joe,

That's a bit odd! Couple of things we can try:

  1. Check there's definitely observers attached to those students in the course that you're viewing the grades in (Hit people on the course menu, check there are users with 'Observing ... ' under the role column for that course, and for the specific students in the message students who box).
  2. In Google chrome, press Ctrl + Shift + i to open the web inspector. Refresh the Grades page with the inspector open to the 'Console' tab, then try to include some observers. See if any errors appear in the console. 
  3. If there's no errors, change the inspector tab to Network. At the bottom of the list of network transactions you should see something like this:
    254590_Screenshot from 2017-09-29 08-33-13.png
    For each one of the enrollments and sections requests if you could right click, then Copy > Copy Response and paste the result in a private message to me I should be able to figure out why it doesn't work Smiley Happy
Surveyor II

New version 0.06 available here:

- Fixes an issue with courses containing more than one hundred enrolments. Thanks Joe for discovering that one.‌, we ran into an issue today with the Include Observers button. One of our teachers was no longer able to add observers to a Conversation sent to an individual student. The button worked fine when all students in the course were selected, and everything worked fine for me in my test accounts. What I found was that our teachers don't have permission to use the search users API (api/v1/courses/{course_id}/search_users?search_term={user id}) that you were using in your script. I don't know if Canvas made a change to the API permissions or if it's a permission setting on our end that's causing the issue, but I swapped out the search users API with the course users API and that got us back up and running.

            switch (v[0]) {
              case 'user':
                if (results.contexts[0] === 'none') {
                  options = {
                    mode: 'users',
                    id: v[1],
                    query: '',
                    type: ''
                } else {
                  options = {
                    mode: 'courses',
                    id: results.contexts[0],
                    //query: 'search_users?search_term=' + v[1],
                         query: 'users/' + v[1],
                    type: ''
Community Member

Our teachers love your script, Stephen!

Is there any way to include the name of the student in the message or subject of the message? I would be mostly helpful when observers with more than one child get the emails. I am no coder but any idea on how I could make that work would be really appreciated.

Thank you so much!

Hi Cynthia,

Glad to hear your teachers have been finding it helpful!

Unfortunately it's not possible to include the name of the students without some coding intervention, but the good news is that including the student's name would definitely be possible. It would require a bit of a rework to a few elements as the script currently sends bulk messages and would need to have the ability to send individual messages, but nothing too strenuous. It's something I've had in mind for a while, but assumed that this functionality would get written into Canvas before I had the chance to do so (see this idea here: ).

What might work well is to have some sort of substitution method, where you could pop something like [student] to have the students name pop out in that spot, or [observer] for the parent's name. Then you could write sentences like "Dear [observer], I'm writing to inform you that [student] achieved an excellent grade in ..."

Perhaps I can have a look at doing something like  this in the coming holidays Smiley Happy

Thanks for the quick reply!

That substitution method is exactly what I had in mind...but I have no idea how to make it work with the code.

I voted up the idea already posted and I sure hope Canvas incorporates it SOON!

In the meantime, teachers will keep using your script as is and I'll cross my fingers you get some time to beat Canvas over the holidays Smiley Wink

Have a great weekend!