Showing results for 
Search instead for 
Did you mean: 
Adventurer III

Add Observers - Invalid Recipient Name

We've been running the script‌ shared to include observers in a Canvas Inbox message. I have staff receiving an invalid recipient name error when they try to send a message where they've used this button, but it seems to be inconsistent:

  • Select student. Click add observers. Send message --- receive invalid recipient name and could not send the message (occurred when the teacher tried to send and when I masqueraded)
  • Added a test student to the course, made myself their observer. Masqueraded as the teacher and repeated the above process. No errors. 
  • Bypassed the scripted function. Selected student and observer directly from the address book lists. No errors.

So I'm stumped, any ideas? The course is published, so that's not the issue. Is it just some thing with this particular student or parent accounts (it's both the mother and father). The mother in this case is also a teacher (but with a separate Canvas account/SIS ID) so it's easy to test with her, I can't really start pushing out test messages to random parents. 

9 Replies
Surveyor II

Hi Audra,

Does this happen for all observers, or just some? I don't suppose there are special characters in the observers name? Might be a programming error on my part. I'll check it out.

I believe you can send test messages on your testing instance at <institusion subdomain> without them being actually sent.


We tried with one student and both parents. I tried removing one parent and then the other an had the same error. When I selected the observers without using the button the message sent without issue, and when I made myself an observer I was able to send the message, so it doesn't appear to be a special character. I'll do some testing in test to see what else I can find. Is there somewhere in the JS I can insert a log statement to see what's getting populated into the field?


Sorry for the delay (busy times!). The issue you're seeing reminded me of another problem that I hadn't got around to fixing. Now that I've cleared that up (latest version here), would you mind checking again to see if your issue persists?

Community Member

I have just begun having the same issue. Through sometime last week, I was able to add observers outside of our LMS, now I am getting an "invalid error" when trying to add parents.

Adventurer III

For the life of me I can't figure out what's triggering this.

  • I've enrolled test students and observers and sent inbox messages from my account and the teacher's account -- No issue
  • In Beta, I've tested Include Observers with other random students in the course -- no issue
  • In Production and Beta, this particular student and parent combo throws the "Invalid Recipient Name" message when you click Send
  • I've tried with both parents as recipients, then each alone and get the same error
  • When I manually select these parents from the Observer list -- No issue
  • I tried installing‌'s version of the include observer code and I get the same error with this child and parent

So, it's gotta be something with the API, but what would be different about this parent/student combo? We enroll all our parents through SIS, so there wouldn't be any issues with accepting invitations, and there are no special characters in their user names or id fields. The parents' name are getting populated in the To field, the error only occurs once you hit send.


if you are still using mine there is a table if you look at the browsers console. it will show a table of associated parents. there are also console.logs that you are able to enable on lines [156, 114, 68] that should help you find your issue...


Did you find the issue or a solution?

Adventurer III

Thanks Jewell and Stephen, I've been completely swamped over here. Jewell, I ran your script in Beta and saw the table you mention in the console. Your script was working for me. Stephen, I updated our script with your new code and my teacher's are reporting that everything is working now. Thanks everyone! 


Cool, glad to hear that's working.‌, one solution to this problem appears to be to use Instructure's own method for inserting recipients to the form, rather than manually creating DOM elements (as I did previously). The function setTokens() of AutocompleteView.js accepts Instructure user objects and neatly creates the appropriate DOM elements, plus whatever else is required to validate the form correctly. You can read Instructure's nicely formatted and commented code here.