I've seen a few questions about an event for when an email is received. And I remembered
this.
If it's possible for a script to display the text from a popup, can a RegExp not be used to see if the toast contains the text "you have received an email from (...)" or "you have (...) new messages in your inbox"?
Just a thought...