Stable release backport: fix grade change email

Original pull request: #1093 

Regression test added after the fact - I can put that back into the main branch too, if it is accepted.