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
32 Replies
Surveyor II

New version 0.02 available here:

Fixes an issue which caused some messages to fail when sending from the gradebook view. 

Community Member is there code to add this functionality to the "Inbox" as well, or just "Message students who..."?  I thought‌ had shown me a version that worked with Inbox as well.  

Correct, this script does apply to the Inbox as well, and adds a little 'include observers' button there too! 

Fantastic.  I look forward to trying it out. -Joe

Surveyor II

Version 0.03 now available here:

- Adds support for sending messages to any kind of group in the inbox view. 


I'm excited to try this out.  I saw the inherent problem with this in that you could easily hang the system if you are trying to look up too many Observers.  Are there any limitations or quirks to this we should be aware of?

It shouldn't totally hang hopefully, I think instead it's just going to take a little while haha! I'm assuming this is happening when, as an account admin, you add a group of students without selecting a course from the course dropdown. When operating in this way the script performs the following: 

  1. splits the group into individuals (lets say 20).
  2. looks up the enrolments for each of those individuals and finds the courses they are enrolled in (lets say they each have 8 enrolments, so that's 20 x 8 = 160).
  3. looks into all 160 courses and gets the enrolment list again.
  4. matches observers from the collected courses enrolments with the original 20. 

That 160 lookups is a bit time consuming, especially as it hits the API rate limit API Rate Limiting (the requests are made concurrently). If you select a course first, then it would only look up students within that course (20x1), so that would be a lot quicker. 

Why not limit the recipient lookups to the course they were specified from, even when the user doesn't select it? Well, some groups that you add have no course information attached (e.g sections and groups) so they require extra lookups to see what that course belonged to etc. In our institution, no teachers actually have the role where they can add users without first selecting a course, so I just left it with this slow method. That said, If this usage scenario that I've described above applies to you, I could possibly have a look at limiting those admin role lookups to apply only to the courses to which the group belongs Smiley Happy How many students are you wanting to look up at a time (ideally) Joe? 

I've also just realised I've forgotten to cull duplicate course lookups (occurring when students are enrolled in the same course), so that's a bit dumb. Might go fix that. That may actually speed it up substantially, and might not hit the API limit so hard. 

Ok, I have new version for you, 0.04 uploaded to github won't look up the same course twice anymore. That cuts down the number of API calls dramatically because we're not hitting the server for things we already know, which was especially a problem when using whole groups of students. Whoops. 

Still a bit slow without a course selected, but much better Smiley Happy. Takes around 30 seconds for 73 students here, quicker if there's more crossover in their course enrolments. 

Awesome stuff Stephen.   I can't tell you how much this new communication capability will help our teachers.   Previously they had to use the SIS to easily communicate with students AND parents.  Often parents will have a last name, so there is no way to tell who belongs to who.  This functionality you built solves all of that and now our teachers will be able to stay in one system.

So, I have one final request...  Is it possible to make the "Send an individual message to each recipient" option be checked by default?  There is zero reason why messages shouldn't be individual.  If they aren't you run into the 'reply all' issue and sometimes even privacy issues.  Thanks for all you do.