Email upon fatal error

I would like to fire off an email alert whenever there is a fatal error on my site.

Does anybody know of an elegant way to do this via the Yii2 built-in error handling mechanism? I took a look through the source code and there didn’t seem to me like any obvious way to do this.

/* moved to general discussions */

have a look here