Fixed fatal error when triggering the email notification